7 Steps to Get Never Expired Facebook Page Access Tokens Do Know It Monday, January 4, 2016 Tech There are several ways to get the Facebook access tokens. Two kinds of access tokens to date are user access token and page access token. Ea... 72 72

7 Steps to Get Never Expired Facebook Page Access Tokens

Print - Save as PDF - Send via email
There are several ways to get the Facebook access tokens. Two kinds of access tokens to date are user access token and page access token. Each type of tokens has its own expired time: 2 hours, 60 days or forever. We will show you how to get the never expired Facebook page access tokens in this tutorial.

Generating Facebook Token

Step 1: Create the application then get the App ID and App Secret

Step 2: Create your own web server and create the redirect URI handler, for example: facebook_handler.php. Your sample file URL can be at http://localhost/facebook_handler.php

Content of the file:

<?php var_dump($_GET);  ?>

Step 3: Configure the app to allow your own web server to handle the redirect URI. Entering your URL (for example: http://localhost/facebook_handler.php) at Advanced Settings -> Valid OAuth redirect URIs

Step 4: Get the authentication code which allows the app to manage your pages. Using the following address, just change to your info.

https://www.facebook.com/dialog/oauth?client_id=[APP_ID]&redirect_uri=[FACEBOOK_HANDLER]&scope=manage_pages,publish_actions,publish_pages

Step 5: Getting 2 hours access token for your app.

https://graph.facebook.com/oauth/access_token?client_id=[APP_ID]&redirect_uri=[FACEBOOK_HANDLER]&client_secret=[APP_SECRET]&code=[OAUTH_CODE]

Step 6: Extending the token in 60 days

https://graph.facebook.com/oauth/access_token?client_id=[APP_ID]&client_secret=[APP_SECRET]&grant_type=fb_exchange_token&fb_exchange_token=[2_HOURS_ACCESS_TOKEN]

Step 7: Get never expired access token for your app to publish on all your facebook pages (current logged in account)

https://graph.facebook.com/me/accounts?access_token=[60_DAYS_TOKEN]

This has been working for several years. If Facebook changes the method to get this access token, we will update the tutorial. Stay tuned for more information.
5 Tech: 7 Steps to Get Never Expired Facebook Page Access Tokens There are several ways to get the Facebook access tokens. Two kinds of access tokens to date are user access token and page access token. Ea...

Latest posts: