বৃহস্পতিবার, ৬ জানুয়ারী, ২০১১

use facebook graph api to socialize your appliation

  • Register the application at http://www.developer.facebook.com/setup to get an app ID and secret. Your Facebook app ID is your client_id and your Facebook application secret is your client_secret.
  • Redirect the user to https://graph.facebook.com/oauth/authorize with your client_id and the URL the user should be redirected back to after the authorization process (redirect_uri):
                       
    https://graph.facebook.com/oauth/authorize?
    client_id=...&
    redirect_uri=http://www.example.com/oauth_redirect
  • After the user authorizes your application, we redirect the user back to the redirect URI you specified with a verification string in the argument code, which can be exchanged for an oauth access token. Exchange it for an access token by fetching https://graph.facebook.com/oauth/access_token. Pass the exact same redirect_uri as in the previous step:
    https://graph.facebook.com/oauth/access_token?
    client_id=...&
    redirect_uri=http://www.example.com/oauth_redirect&
    client_secret=...&
    code=...
  • Use the access token returned by the request above to make requests on behalf of the user:
                      https://graph.facebook.com/me?access_token=...

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন