Hi, iam using facebook connect in my site, and i want to know how do i use the graph api for authenticating the user. I followed these steps:
1) Initially i sent a request for "code", by clicking on the facebook icon in my site:
https://graph.facebook.com/oauth/authorize?
client_id=xxx&redirect_uri=http://xxxxxxxx
2) And then after getting a code, i sent a request for "access token", by clicking on another link in my site:
https://graph.facebook.com/oauth/access_token?
client_id=xxx&redirect_uri=http://xxxxxxx&client_secret=xxxx&code=xxxxx
3) And after i got the token, i sent another request for getting user data, by clicking on yet another link:
https://graph.facebook.com/me?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Then finally i got the user data in array format, which i need to parse for my required data like user's firstname, email, etc.
Now my question is that how i can automate this process with just one click ?
Right now, iam using 3 different links for sending those requests.
Can anyone suggest a solution ?