从Facebook获取长时间的实时访问令牌 [英] Get long live access token from Facebook
问题描述
offline_access
权限,并引入了一个名为长期访问令牌的概念,最长为60天。有谁知道如何使用Facebook JavaScript SDK获取此访问令牌? 有一种方法可以将其延长至60天。在此描述: https://developers.facebook.com/docs/roadmap/completed-更改/脱机访问删除/
在情况4:客户端OAuth和扩展Access_Token通过新端点的到期时间
编辑:
为了扩展访问令牌,您需要使用短暂的访问令牌进行以下请求:
https://graph.facebook.com/oauth/access_token?
client_id = APP_ID&
client_secret = APP_SECRET&
grant_type = fb_exchange_token&
fb_exchange_token = EXISTING_ACCESS_TOKEN
As I understand it, recently Facebook has decided to remove the offline_access
permission and has introduced a concept called long-lived access tokens which last a maximum of 60 days. Is there anyone who knows how to get this access token with the Facebook JavaScript SDK?
There is a way to extend this to 60 days. described here: https://developers.facebook.com/docs/roadmap/completed-changes/offline-access-removal/
under Scenario 4: Client-side OAuth and Extending Access_Token Expiration Time through New Endpoint
Edit: In order to extend the access token you need to make the following request with your short lived access token:
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN
这篇关于从Facebook获取长时间的实时访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!