OAuthException : An active access token must be used to query information about the current user

前端 未结 2 910
梦毁少年i
梦毁少年i 2021-01-18 13:00

I\'m trying to run the sample code for Facebook connect that I downloaded from http://thinkdiff.net/facebook/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/
I get

相关标签:
2条回答
  • 2021-01-18 13:42

    You must ensure that your access token is active. Or maybe you're in logout condition. Or try to clean the cookies and cache from your browser (ctrl+shift+del)

    0 讨论(0)
  • 2021-01-18 13:46

    Please check if you are getting any Facebook exceptions like

    An active access token must be used to query information about the current user.

    which causes 0 as user id in return from $facebook->getUser().

    So please check with getAccessTokenFromCode() from base_facebook.php and verify access_token_response format as it may be in JSON format.

    So try to use appropriate decoding method to get $response_params['access_token'] from $access_token_response.

    0 讨论(0)
提交回复
热议问题