fb_exchange_token for PHP只有在用户删除应用程序后才能工作 [英] fb_exchange_token for PHP only working once user removes app

查看:93
本文介绍了fb_exchange_token for PHP只有在用户删除应用程序后才能工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我正在建立的Facebook应用程序,我需要的时间比默认的1 - 2小时要长。



我不想使用offline_access作为它让人们从注册到应用程序,现在贬值。



在开发人员路线图中,它谈到fb_exchange_token,这将扩展访问令牌到期日期1个月。



流程是:




  • / p>


  • 呼叫... / oauth / access_token?...& grant_type = fb_exchange_token& fb_exchange_token = ...


  • 访问令牌现在是1个月了



这对所有新用户都适用,对于删除应用程序从他们的Facebook帐户重新添加,但对于我们现有的客户群,它不起作用。



我已尝试过各种类型,包括添加其他权限登录脚本强制验证窗口,但没有运气。



我已经添加了正确的高级/ migrat离线设置为Facebook应用程序,如文档中所述。除了开发博客,除此之外,似乎没有什么帮助。



任何帮助将不胜感激。



FYI:我使用最新的PHP SDK,代码获取新的访问令牌只是指向以下url的标准cURL请求:



https://graph.facebook.com/oauth/access_token?client_id= {APPID}& client_secret = {APPSECRET}& grant_type = fb_exchange_token& fb_exchange_token = {ACCESSTOKEN}



再次感谢

解决方案

我有同样的问题。另一件事我注意到:以前拥有offline_access权限的用户也可以获得60天的令牌以及新授权的用户。



我打开了错误尝试从FB获得回复: https://developers.facebook.com/bugs/241373692605971


For a Facebook app that I am building, I require longer time than the default 1 - 2 hours.

I don't want to use "offline_access" as it puts people off from signing up to the app and is now depreciated.

In the developer road map it talks about "fb_exchange_token" which will extend the access token expiry date to 1 month.

The flow is:

  • Login User

  • Call .../oauth/access_token?...&grant_type=fb_exchange_token&fb_exchange_token=...

  • Access token is now 1 month long

This works fine for all the new users, and for users who delete the app from their Facebook account and re-add it, but for our existing customer base, it doesn't work.

I have tried all sorts including adding other permissions to the login script to force the authenticate window, but no luck.

I have added the correct advanced/migration setting for the Facebook app as described in the documentation. There doesn't appear to be much help on this, apart from the dev blog.

Any help will be greatly appreciated.

FYI: I'm using the most up-to-date PHP SDK and the code to get the new access token is just the standard cURL request pointing to the following url:

https://graph.facebook.com/oauth/access_token?client_id={APPID}&client_secret={APPSECRET}&grant_type=fb_exchange_token&fb_exchange_token={ACCESSTOKEN}

Thanks again

解决方案

I am having the same issue. One other thing I've noticed: users that previously had the offline_access permission are also able to get the 60 day tokens, as well as newly authorized users.

I opened a bug to try to get a response from FB: https://developers.facebook.com/bugs/241373692605971

这篇关于fb_exchange_token for PHP只有在用户删除应用程序后才能工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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