Facebook non-expiring access token

后端 未结 2 1749
粉色の甜心
粉色の甜心 2020-12-09 22:09

I want to show the last facebook post on my website. I have a script for it but it needs access token to work.

I followed the steps mentioned in this post:

h

2条回答
  •  春和景丽
    2020-12-09 22:58

    1: Create an application in facebook with your website url

    2: Run this link in your browser

    3: Visit the following to generate a new SHORT-LIVED (1 hour) access token:

    https://www.facebook.com?client_id=[APPID]&client_secret=[APPSECRET]&redirect_uri[http://APPURL]&scope=manage_pages,read_stream&response_type=token
    

    4: Take that short-lived access token and send it here:

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

    5: Then, either in FB’s Graph API Explorer or on your own, visit here:

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

    Then paste the token and id in the code, then you will get the result.

    You can debug and verify the expiration date of your token using the FaceBook Access Token Debugger:

提交回复
热议问题