Thursday, April 3, 2014

How to generate Facebook token ?


  • Do you have your app already on Facebook Developer site? If no Facebook developer site (https://developers.facebook.com) > Apps in top menu > Create New App


(Caution don’t forget to verify  your FB account before creating app . > www.facebook.com/help/verify )

  • Visit Graph API Explorer (http://developers.facebook.com/tools/explorer) and get Access token for above created App. (Caution: I have given all possible permission to my token generated, you can choose to generate it with restricted usage.)

Choose above created app in application drop down , Click on Get access Token , I have given all possible permissions to this token in all three tabs.


  • Keep safe content of Access Token Text box safe for future use .  ( This is expected to expire in around 1 hour or so )

  • Suppose your target requirement is to generate token which last as long as 60 days ,  open below  url in your browser :

https://graph.facebook.com/oauth/access_token?client_id=000000000000000&client_secret=0000aaaa1111uuuu3333hhhh7777xcvd&grant_type=fb_exchange_token&fb_exchange_token=00000000000000000000000000000000000000000ffffffffffffffffffffff00000000000000jjjjjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkk3333333333333333338888888888888888888888888llllllllooooooooooooo4444444444444zzzz

Below mentioned images will give you idea where they are located : ( Hint , existing valid fb_exchange_token  before opening this url in browser , is something you saved in previous step



  • Response from browser will be something like below mentioned .  Please note you are able to do this because Valid OAuth redirect URIs  is blank for this app .

access_token=00000000000000000000000000000000000000000ffffffffffffffffffffff00000000000000jjjjjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkk3333333333333333338888888888888888888888888llllllllooooooooooooo4444444444444zzzz&expires=5183595      ( about 60 days )

  • Save this magic token which expires in about 60 days .

  • Bookmark this post , because you will have to visit this post back in 60 days !!!!

1 comment: