【问题标题】:Extending existing offline access_tokens扩展现有的离线 access_tokens
【发布时间】:2012-03-07 18:43:36
【问题描述】:

我必须扩展存储在我的数据库中的所有用户的离线访问令牌

在这里我找到了方法 https://developers.facebook.com/docs/offline-access-deprecation/

但是当我使用这个调用时

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 

对于某些用户,我获得了新令牌

access_token=xxxxxxx&expires=5102358

对于其他人我没有收到任何东西,为什么?

我用这个代码

$request_url = "https://graph.facebook.com/oauth/access_token?client_id=xxxx&client_secret=xxxx&grant_type=fb_exchange_token&fb_exchange_token=xxxx";

$info = file_get_contents($request_url);

提前感谢您的帮助。

【问题讨论】:

    标签: facebook access-token


    【解决方案1】:

    其他用户的访问令牌在您尝试转换时可能已经过期。您只能扩展未过期的访问令牌。一旦它们过期,您将需要让您的用户回到应用程序以重新验证。

    【讨论】:

    • 我的印象是 facebook 的 OAuth 实现不包括刷新令牌部分。那改变了吗?有任何官方文件吗?我找不到任何
    • developers.facebook.com/docs/offline-access-deprecation 请参阅客户端 OAuth 和通过新端点延长 Access_Token 过期时间部分。
    • graph.facebook.com/oauth/access_token? client_id=APP_ID& client_secret=APP_SECRET& grant_type=fb_exchange_token& 此代码在 FF Chrome 中为我提供了访问令牌,但在 IE 中并非所有版本,它显示结果为 {"readyState":0,"status":0,"statusText":"Error: Access is被拒绝。\r\n"}
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-01
    相关资源
    最近更新 更多