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

前端 未结 2 912
梦毁少年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: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.

提交回复
热议问题