Facebook Oauth 2.0 访问令牌会过期吗? [英] Do Facebook Oauth 2.0 Access Tokens Expire?

查看:39
本文介绍了Facebook Oauth 2.0 访问令牌会过期吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Facebook 中使用 Oauth 2.0 授权,想知道 Facebook 发出的访问令牌是否会过期.如果是这样,有没有办法请求长期访问令牌?

I am playing around with the Oauth 2.0 authorization in Facebook and was wondering if the access tokens Facebook passes out ever expire. If so, is there a way to request a long-life access token?

推荐答案

经过一番挖掘,我找到了这个.答案似乎是:

After digging around a bit, i found this. It seems to be the answer:

更新(2018 年 4 月 11 日)

  • 令牌将在大约 60 天后过期.
  • 当使用您的应用的用户向 Facebook 服务器发出请求时,令牌将每天刷新一次,最多 90 天.
  • 所有访问令牌都需要每 90 天更新一次,并征得使用您的应用的人的同意.

Facebook 变更公告 (10/04/2018)

Facebook 更新了令牌过期页面 (10/04/2018)

离线访问:使您的应用程序能够随时代表用户执行授权请求.默认情况下,大多数访问令牌会在短时间内过期,以确保应用程序仅在用户主动使用应用程序时代表用户发出请求.此权限使我们的 OAuth 端点返回的访问令牌长期有效.

offline_access: Enables your application to perform authorized requests on behalf of the user at any time. By default, most access tokens expire after a short time period to ensure applications only make requests on behalf of the user when the are actively using the application. This permission makes the access token returned by our OAuth endpoint long-lived.

这是一个请求的权限值.

Its a permission value requested.

http://developers.facebook.com/docs/authentication/permissions

更新

offline_access 权限已被移除一段时间.

offline_access permission has been removed a while ago.

https://developers.facebook.com/文档/路线图/已完成的更改/离线访问删除/

这篇关于Facebook Oauth 2.0 访问令牌会过期吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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