从Facebook获取长时间的实时访问令牌 [英] Get long live access token from Facebook

查看:173
本文介绍了从Facebook获取长时间的实时访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,最近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屋!

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