Most of the applications over web these days need to get connected with each other. With the surge of Social Aware applications people started integrating all of their social application in one location. Following is my attempt to solve the "Complex" but easy puzzle for novice developers
To start with i’ll demonstrate how to Login with Facebook and details of facebook user into your application
Lemme first explain what OAuth means in Brief. Below is the diagram which explains
First we call Service provider with ClientID / CallBack URL and Some additional Parameters based on Service provider you use
Then if we pass the right parameters then Service provider will give us a call back to given callback URL with Authorization Token and some parameter that states time to live
Now we can use this Authorization token in our subsequent requests to Service Provider Provided services
Here is example of facebook
Step 1
Goto Facebook developer Page
Step 2
Register your App. You will get you app key/secret etc
Step 3
Now goto this sample URL to get your token
Test with this URL
Replace Corresponding Tokens for your Application
Step 4
Once you get Call back get the access_token from the request and store it
Example
—————–
Step5
——–
Get user Data using the above token.
https://graph.facebook.com/me?access_token=168452316544703|2.WKMyHmlbzscco7HjrkJUMw__.3600.1304560800.1-100000131478113|9IpaoHOvCIfS4bqRZSqbu5-Rp8E
This gets user data in following format
{ "id": "100000131478113", "name": "Ashwin Kumar", "first_name": "Ashwin", "last_name": "Kumar", "link": "http://www.facebook.com/profile.php?id=100000131478113", "birthday": "06/24/1984", "hometown": { "id": "103095893064172", "name": "Rajahmundry" }, "location": { "id": "103129393060364", "name": "Allentown, Pennsylvania" }, "work": [ { "employer": { "id": "111926488822704", "name": "Freelancer" }, "position": { "id": "130875350283931", "name": "CEO & Founder" }, "start_date": "0000-04", "end_date": "0000-00" }, .............. ........... .............
Njoy integrating facebook to your application. Subsequent series will Cover Google/Twitter/LinkedIn/Yahoo Integration. Also writing a java library for this.. Will share that in opensource once done
Njoy playing with social apps….