Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Never Expiring Facebook Page Access Token

I have been trying to find a way to create a never expiring FaceBook Page Access Token. I have seen the option where you provide the AppID|AppSecret in place of the token however that requires you to submit the app for approval and facebook does not seem to understand concept of OTHER apps using the token. Regardless, see the answer below for how I found a way to do this.

like image 682
George M Ceaser Jr Avatar asked Nov 28 '18 00:11

George M Ceaser Jr


1 Answers

After piecing together many different solutions - I did this and it seems to work. I assume you only want a token for a single page and that you already have your Facebook app page setup.

  1. Get the ID of the page by navigating to it from a web browser, click on About link in the menu list down the left hand side of the page, then scroll to the bottom of the About information and you will see the Page ID display.

  2. Navigate to Facebook Graph API Explorer

  3. Remove everything after the API Version (in this case v3.2) on this line of the explorer
    enter image description here

and replace it with 123456789?fields=access_token where 123456789 is your page ID.

enter image description here

  1. Click the Submit button to the right hand side of the line you just entered the text into.

    1. You will receive a token back in the response at the bottom of the screen that looks similar to this:

{ "access_token": "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT", "id": "1755746091324056" } where TTTTTTTT is your access token.

  1. Copy the token only (no quotes) out of the response and past it in the Access Token field at the top of the Page replacing the Access Token that was previously there.

enter image description here

  1. After pasting in the new access token click on the blue information icon to the left of the access token.

  2. In the Access Token Information dialog, click on the 'Open in Access Token Tool' button at the bottom right of the dialog.

enter image description here

  1. In the Access Token Debugger that will open up, click on the 'Extend Access Token' button at the bottom of the page. A new access token should be displayed and the text above it should say that it never expires.

enter image description here

I hope this helps.

PS - Here is what I see in Facebook's Access Token tool when I paste the token generated using this method into it. It says this token will never expire.

enter image description here

like image 138
George M Ceaser Jr Avatar answered Nov 19 '22 11:11

George M Ceaser Jr