How to extend facebook access token in python

后端 未结 3 517
夕颜
夕颜 2021-02-06 14:37

I am using the Python facebook-sdk client library. I currently have a short-lived access token obtained from https://developers.facebook.com/tools/accesstoken/ that I copy the c

3条回答
  •  花落未央
    2021-02-06 15:15

    According to their subsection on extending short lived client tokens, you'll need to take in your short lived client token and, having filled in the relevant app data, send a GET request from your server to the following endpoint:

    GET /oauth/access_token?  
      grant_type=fb_exchange_token&           
      client_id={app-id}&
      client_secret={app-secret}&
      fb_exchange_token={short-lived-token}
    

    The response will contain your long-lived access token which can then be passed back to the client or used on your server. If you don't currently have a module for performing HTTP operations, I highly recommend Requests.

提交回复
热议问题