Error Validating Access Token

前端 未结 1 1778
无人及你
无人及你 2021-01-18 09:28

I get this error occasionally:

Fatal error: Uncaught Exception: 190: Error validating access token: This may be because the user logged out or

相关标签:
1条回答
  • 2021-01-18 10:11

    As written in How-To: Handle expired access tokens (link is broken) developers blog post

    Access tokens for users can become invalid due to various reasons. In most cases, they can expire if it’s past the time specified by the expires field (by default access token have a 2 hour lifetime). What many developers do not realize is that an access token can also expire if a user changes her password, logs out or if she de-authorizes the app via the App Dashboard. It is very important that your apps handle such situations. If your access token expires, you need to reacquire a valid access token.

    Before we could use offline_access permission to get token that not expire (unless user is connected with application), this permission is now deprecated, see Deprecation of Offline Access Permission to see how you can get access_token with longer expiration time.

    Update:
    As of Aug 2012 Facebook PHP-SDK have added simple way of extending access_token (see How to extend access token validity since offline_access deprecation for more details)

    Update 2: Note that original blog-post from Facebook about expired tokens handling doesn't exists anymore. There is new documentation hewever that may be used to get the details. https://developers.facebook.com/docs/facebook-login/access-tokens/#extending

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