第一次获取 Facebook 访问令牌的到期时间是多少

发布于 2025-01-08 02:15:53 字数 170 浏览 0 评论 0原文

几天前,我尝试刷新访问令牌,观察到“Web”类型的应用程序的初始访问令牌到期时间约为 2 小时,而“本机/桌面”类型的应用程序的初始访问令牌到期时间为 25 小时。 但从今天早上开始,我发现对于本机/桌面类型应用程序,初始访问令牌到期时间为 60 天。 所以我想知道 Facebook 中是否有关于应用程序初始到期时间的记录?

Few days back I was trying to refresh access token and observed for "Web" type of app the initial access token expiry time is around 2 hrs and for "native/desktop" type app its 25 hrs.
But since today morning I am seeing that for native/desktop type app the initial access token expiry time is 60 days.
So I was wondering if it is documented somewhere about the initial expiry time of an app in Facebook ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

洋洋洒洒 2025-01-15 02:15:53

所以我想知道 Facebook 中是否有关于应用程序初始到期时间的记录?

是的,这是我们关于该主题的当前官方文档:

https://developers.facebook .com/docs/offline-access-deprecation/

So I was wondering if it is documented somewhere about the initial expiry time of an app in Facebook ?

Yes, here's the current official documentation we have on the subject:

https://developers.facebook.com/docs/offline-access-deprecation/

韶华倾负 2025-01-15 02:15:53

我认为没有任何官方文档解释如何计算到期时间。但是,当 access_token 传递到您的应用程序时,您还应该收到一个“expires”参数。

expires 参数是令牌需要重新验证之前的秒数。在对应用程序进行编码时,请确保记录下来并提示用户在其个人资料过期时重新链接。

一些注意事项:

  • 您可以请求“offline_access”权限无限期到期。

  • 如果用户更改密码或从其隐私/安全设置取消对您的应用程序的授权,则令牌将自动失效。

I don't think there is any official documentation that explains how the expiry time is calculated. However, when the access_token is passed to your application, you should also receive an "expires" parameter.

The expires parameter is the number of seconds until the token needs to be revalidated. When coding your app, make sure to record this and prompt the user to relink their profile when it expires.

Some notes:

  • You can request "offline_access" permission for infinite expiry time.

  • The token will automatically become invalidated if the user changes their password or deauthorizes your application from their privacy/security settings.

不一样的天空 2025-01-15 02:15:53

应用程序高级设置中有一个新选项:弃用offline_access

如果启用,应用程序将获得长期访问令牌,但您不能要求offline_access。我相信弃用过程完成后,到期时间将恢复正常,或者他们可能会将其保留为 60 天。

There is a new option in App Advanced Settings: deprecate offline_access

If enabled the app will be issued long lived access token but you can't ask for offline_access. I believe after deprecation process is completed the expiry time will return to normals or they might leave it to 60 days.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文