Never Expiring Facebook Page Access Token

泄露秘密 提交于 2020-07-04 18:31:34

问题


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.


回答1:


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

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

  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.

  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.

  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.

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.



来源:https://stackoverflow.com/questions/53510296/never-expiring-facebook-page-access-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!