有人知道 Facebook API 访问令牌的有效期吗?
FB oAuth API 中访问令牌的生命周期是多长?
不是扩展的离线许可,只是普通的访问令牌?
what is the lifespan of an access token in the FB oAuth API?
Not the extended offline permissioning, just a normal access token?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不指定离线权限,则令牌仅在用户登录 Facebook 时有效,并且仅在传回给您的到期时间过去之前有效。我认为一般在 2 小时左右,但我还没有验证。您可以从 Facebook 的文档中找到更多信息。
http://developers.facebook.com/docs/authentication/
If you don't specify the offline permission, then the token is only valid while the user is signed in to Facebook and only until the expiry that gets passed back to you passes. I think it is somewhere around 2 hours generally but I haven't verified it. You can find more information from Facebook's documentation.
http://developers.facebook.com/docs/authentication/
颁发访问令牌时会返回用户访问令牌到期信息(您会看到它附加到 access_token 的末尾)。目前为 2 小时,但可能会发生变化。要记住的关键一点是,访问令牌可能会因多种原因而变得无效,您需要确保准备好处理这种情况。请参阅以下操作方法:https://developers.facebook.com/blog/post/ 500
应用程序访问令牌目前没有到期日,但我希望我们能够更改这一点,并且您还应该准备好处理此令牌无效的情况。
User access token expiry is returned when the access token is issued (you see it appended to the end of the access_token). It is currently 2 hours, but that is subject to change. The key thing to remember is that access token can become invalid for a number of reasons and you need to make sure that you are prepared to handle that case. See the how-to for this at: https://developers.facebook.com/blog/post/500
App access tokens have no expiry right now, but I expect that we are going to change that and you should also be prepared to handle the case where this token becomes invalid.