Getting “Error validating access token” from Facebook for some users

自作多情 提交于 2019-12-03 07:08:16

问题


I'm getting the following error from Facebook when trying to post to a users stream.

Error validating access token: The session has been invalidated because the user has changed the password or because auth.expireSession was called.

The workflow is as follows:

  1. Authorize with Facebook requesting scope=offline_access,publish_stream permissions (if the current user has not already authorized)

  2. Do some work on the server (takes 5-10 minutes)

  3. Attempt to publish to the user's Facebook stream

This code works for many users, but for some users, I get the Error validating access token error. It started frequently happening a few weeks ago, then seemed to stop, and now happen a lot again. I'm certainly not calling auth.expireSession on my end, and it seems unlikely that multiple users would be changing their password in the 5-10 minute window from authorizing to publishing. Does anyone know what might be causing this?


回答1:


Anytime you get this error, you should run the user back through the auth flow. There are many reasons that either the user or we will invalidate a session. We have a how-to on this at https://developers.facebook.com/blog/post/500



来源:https://stackoverflow.com/questions/5972901/getting-error-validating-access-token-from-facebook-for-some-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!