cppit
cppit

Reputation: 4564

Uncaught OAuthException: An active access token must be used... this is returned even if the access token is found

I am getting this error while using the facebook api, but when I print_r the object this is what I get :

Facebook Object
(
    [facebook] => Facebook Object
        (
            [sharedSessionID:protected] => 
            [appId:protected] => APP_ID
            [appSecret:protected] => APP_SECRET
            [user:protected] => 0
            [signedRequest:protected] => 
            [state:protected] => 
            [accessToken:protected] => ACCESS_TOKEN
            [fileUploadSupport:protected] => 
            [trustForwarded:protected] => 
        )

    [fb_perms] => Array
        (
            [scope] => publish_actions,
                            read_friendlists,
                            user_birthday,
                            email,
                            ads_management
        )

    [fb_user] => 0
    [fb_user_profile] => 
)
<br />
<b>Fatal error</b>:  Uncaught OAuthException: An active access token must be used to query information about the current user.
  thrown in <b>base_facebook.php</b> on line <b>1271</b><br />

the top part says that there is an access token how come I cant use it ?

Upvotes: 0

Views: 118

Answers (1)

Tobi
Tobi

Reputation: 31479

From the structure of the provided Access Token before I removed it (please, never ever show your App ID, App Secret and Access Token on a public website!!!), it seems like you were using an Application Access Token instead of an User Access Token.

You have to use the latter everytime you want to query for user information.

Upvotes: 1

Related Questions