Facebook full permission AccessToken alternative to Offline access token

后端 未结 2 557
死守一世寂寞
死守一世寂寞 2021-01-12 08:25

Currently I am using desktop windows service to download my Facebook page insights/ page likes/friends etc. graph data . so, for that i have added app on my facebook page an

相关标签:
2条回答
  • 2021-01-12 09:00

    To fix this you need to extend the short lived token.

    You can also debug the access token without any user interaction to see if the action of extending the access token worked.

    This link is a good reference about the expiration of offline access.

    When you debug the access token using this url:

    https://graph.facebook.com/debug_token?input_token=INPUT_TOKEN&access_token=ACCESS_TOKEN

    INPUT_TOKEN is the user access token

    ACCESS_TOKEN is the app access token which is formed like so: APP_ID|APP_SECRET To clarify on that, If my app id is 123 & the app secret is abc then the app access token is 123|abc

    0 讨论(0)
  • 2021-01-12 09:19

    Simple solution just call following functions using PHP SDK

    $facebook->setExtendedAccessToken();
    

    and after it get extented access token through

    $access_token = $facebook->getAccessToken();
    

    OR

    GET /oauth/access_token?  
        grant_type=fb_exchange_token&           
        client_id={app-id}&
        client_secret={app-secret}&
        fb_exchange_token={short-lived-token} 
    
    0 讨论(0)
提交回复
热议问题