Facebook 访问令牌无效并带有消息“会话与当前存储的会话不匹配"? [英] Facebook access token invalid with message "session does not match current stored session"?

查看:20
本文介绍了Facebook 访问令牌无效并带有消息“会话与当前存储的会话不匹配"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在发布到 facebook 新闻源流时开始收到此错误应用程序用户,我确实有访问令牌的离线访问权限,并且它们有效以前很好.30-40% 的用户会出现此错误.

I have recently started getting this error while posting to facebook newsfeed stream of an app user, I do have an offline access permission for the access tokens, and they worked fine previously. This error is coming for 30-40% of the users.

"Error validating access token: Session does not match current stored session.
This may be because the user changed the password since the time the session
was created or may be due to a system error."

推荐答案

您的访问令牌可能因 各种原因(到期时间已过、用户更改密码、用户取消对您的应用的授权、用户退出 Facebook 等).您应该始终在设计时考虑到这种情况.

It's possible for your access token to become invalid for a variety of reasons (expiry time passed, user changed password, user deauthorized your app, user logged out of Facebook, etc.). You should always design to account for this scenario.

如果您的用户处于活跃状态,则无需他们轻松获取来自 OAuth 端点的新访问令牌做/看任何事情.如果没有,您应该制定一个计划(例如通过电子邮件发送给他们)如何让他们返回,以便您可以获得新的访问令牌.您所描述的场景不一定不寻常.您可以在此处 获取有关如何处理过期访问令牌的帮助.

If your users are active, it's easy to get a new access token from the OAuth endpoint without them having to do/see anything. If not, you should make a plan (such as emailing them) for how you will get them to return so you can get a new access token. The scenario you're describing is not necessarily unusual. You can find some code samples here for help on how to handle expired access tokens.

这篇关于Facebook 访问令牌无效并带有消息“会话与当前存储的会话不匹配"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆