Facebook页面访问令牌 - 这些是否过期? [英] Facebook Page Access Tokens - Do these expire?

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

问题描述

我正在构建一个允许用户管理他们的Facebook粉丝页面的应用程序。这需要以下两个访问令牌:


  1. 用户访问令牌

  2. 页面访问令牌

我非常熟悉用户访问令牌,但不符合页面访问令牌。


$ b $有没有人知道页面访问令牌有效期多长?所有我可以在Facebook网站上找到的是这个简洁的段落,其中没有提到任何关于它的到期。



我可以假设,如果我要求用户访问令牌与 offline_access 权限页面访问令牌也将无限期地持续(除非用户更改密码或手动解除我的应用程序)?



我问,因为我想知道如何通常我应该查询Facebook Graph API并获取页面访问令牌。用户注册时应该只要一次请求吗?还是应该在他们不断变化的情况下请求他们一个API呼叫?后者显然是更多的税收!

解决方案

页面令牌到期时,访问令牌过期为用户生成页面令牌。 编辑6.28.2013:如果您扩展用户访问令牌,并获得新的页面访问令牌< a>为用户,该页面令牌不会过期,除非用户取消授权您的应用程序。



离线访问现已被弃用,但您可以扩展访问令牌持续60天。如果您扩展用户的访问令牌,则从该用户帐户生成的页面令牌也将其过期扩展以匹配不会过期(编辑6.28.2013)。页面令牌的值可能会在扩展后更改,因此在扩展用户令牌后,请务必从用户的 / accounts 图连接中获取新的页面令牌。



您可以继续每天延长这些访问令牌一次。因此,您应该每天重新生成用户与您的应用程序互动的访问令牌。



请参阅
https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens
https://developers.facebook.com/docs/facebook-login / access-tokens /#extensions
https://developers.facebook .com / docs / facebook-login /

https://developers.facebook.com/roadmap/offline-access-removal/
https://developers.facebook.com/blog/post/2011/05/13/how-to-handle-expi红色访问令牌/


I'm building an app that allows users to administrate their Facebook Fan Pages. This requires the following two Access Tokens:

  1. A User Access Token
  2. A Page Access Token

I'm quite familiar with User Access Tokens, but not with Page Access Tokens.

Does anybody know how long the Page Access Token remains valid? All I can find on the Facebook website is this succinct paragraph, which doesn't mention anything about it's expiry.

Can I assume that if I am requesting the User Access Token with the offline_access permission the Page Access Token will also last indefinitely (unless the user changes their password or manually deauthorises my app)?

I'm asking because I want to know how often I should query the Facebook Graph API and acquire Page Access Tokens. Should I simply request them once when the user registers? Or should I request them one each API Call in the event they continuously change? The latter is obviously more taxing!

解决方案

Page Tokens expire when the access token expires for the user that the page token was generated from. Edit 6.28.2013: If you extend the user access token and obtain a new page access token for the user, that page token will not expire unless the user de-authorizes your app.

Offline access has now been deprecated, but you are allowed to extend an access token to last for 60 days. If you extend the user's access token, then the page tokens generated from that user account will also have their expiration extended to match will not expire (edited 6.28.2013). The value for the page tokens may change after being extended, so be sure to grab new page tokens from the user's /accounts graph connection after extending the user token.

You can continue to extend these access tokens once per day. So you should regenerate the access tokens each day that the user interacts with your app.

See https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens https://developers.facebook.com/docs/facebook-login/access-tokens/#extending https://developers.facebook.com/docs/facebook-login/
https://developers.facebook.com/roadmap/offline-access-removal/ https://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens/

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

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