PHP SDK: How do I capture the access token after user auths app?

后端 未结 4 871
遥遥无期
遥遥无期 2020-12-18 16:26

This is for a canvas app on the Facebook Platform using the new(est) Facebook PHP SDK.

We are using the PHP example from the Facebook tutorial (https://developers.fa

4条回答
  •  没有蜡笔的小新
    2020-12-18 16:53

    You can use the facebook build in method getAccessToken() for example;

    $access_token = $facebook->getAccessToken();
    

    This will give you the access token to your variable, now if you are getting it empty, remember to first check if the fuid is being properly catch, if it isn't you might need to review your settings be sure your "App Domain" is set this part is very important after setting it correctly you need to reset your app secret, then set your new values in your auth code. Hope this help, let me know :)

    pd. Also remember to keep the scope of your variables visible in your whole php file or class.

提交回复
热议问题