Steps to create never expiring Facebook access token

Jul 4, 2018 / Updated on Jul 4, 2018

  1. Open Graph API Explorer https://developers.facebook.com/tools/explorer
  2. Select the application in the “Application” drop-down menu (Note: Not the “My Apps” menu)
  3. Click “Get Token” > “Get User Access Token”
  4. In the pop-up, under the “Extended Permissions” tab, check “manage_pages” and “publish_pages”
  5. Click “Get Access Token”
  6. In the popup, grant access from a Facebook account that has access to manage the target pages (This popup will flash and disappear if permissions are already granted)
  7. Copy the token that appears in the “Access Token” field (which is your short-lived access token)
  8. Invoke the following URL which gives long lived token (expires in 2 months): https://graph.facebook.com/oauth/access_token?client_id=<>&client_secret=<>&grant_type=fb_exchange_token&fb_exchange_token=<>
  9. Copy the access token for the required page
  10. Invoke the following url which gives never expire token https://graph.facebook.com/me/accounts?access_token=<>
  11. Validate the token using https://developers.facebook.com/tools/debug/accesstoken
comments powered by Disqus
Categories:
Tags: