0

I have some skills in PHP and now I'm planning to develop a connect function for remote login to my web side. I can't find any useful on Google.

Some idees on how to code a API connect button? Something similiar to Facebook connect, Twitter connect etc. BUT this should not rely on facebook api. I'm going to make my own stand alone api.

I know I need to use REST in backend, but I'm missing the knowledge to know how to send / recive the login data, and how to know when a user are online or not.

I also know that the user will need a key of some sort.

My plan was something so easy as this:

yourdomain.com/api?id=xx&key=xxx&what=

then what is should be the action with som parameters like:

if($what == login) {
handle the login part here
return the data
}

I can handle the php on the server side, but don't have a clue on how to handle the rest except the remote site must get the data in json or xml format and save in database. Then when connect, it sends some data back to my site.

But HOW?? Here I'm stuck.

Also how to figure out when user are online on the other site or not, and how to get the image for a button. Like Facebook have a blue icon.

I guess it's a call back to my site for getting the image from there, right?

Greatfull for any answers on this one.

musefan
  • 47,875
  • 21
  • 135
  • 185
  • Some basic info on REST API with PHP -> http://www.gen-x-design.com/archives/create-a-rest-api-with-php/ – Manse Nov 25 '11 at 16:36
  • SO question about Authentication -> http://stackoverflow.com/questions/1453551/rest-user-authentication – Manse Nov 25 '11 at 16:39

1 Answers1

0

Its a pretty large topic you have there, you'll need to do some research as there are many many ways and technologies and security aspects related to this.

I'd suggest you go with a secure connection on a SOAP service based off Zend Soap Server and Zend Soap Client. But then again, if you don't want to use ZEND or SOAP, you'll have to look at other methods.

I wouldnt use REST because REST is used to manage data such as PUT/POST = UPDATE/INSERT, DELETE = DELETE, GET = SELECT so i don't really recon this would make sense.

My biggest point i have to make is, MAKE APIS, something simple, you don't want people to have to ask you for help or read documentation on how to access your authentication service. Go something simple, clean, portable and provide API to simplify your user's experience.

My 2 cents :P

Mathieu Dumoulin
  • 12,126
  • 7
  • 43
  • 71
  • I agree this could be complicated, but so are my site too because I'm working on a social network side. And therefor I need this function. I also need to find a way to make a developer plattform, but here I guess I must use normal API calls. Right? You have any places where I can read on this? Links? – Kenny Flashlight Nov 25 '11 at 17:33
  • Nah sorry, i just dig around and don'T really keep links – Mathieu Dumoulin Nov 25 '11 at 17:57