禁用离线访问并从应用程序设置中删除应用程序后,我不再获得扩展访问令牌
** 看来这是 Facebook 已修复的一个错误。
我禁用了 offline_access
,以便无需请求 offline_access
权限即可获得扩展访问令牌。
在测试时,一开始似乎工作正常。我得到了一个 60 天后过期的令牌。然后我从 Facebook 的应用程序设置中删除了该应用程序,以便我可以进行测试。一旦我删除它,我就开始获得 2 小时后过期的令牌。
这是一个错误吗?或者这可能是一个安全问题,就像应用程序被删除后,就会设置一个标志不允许扩展令牌?请来自 Facebook 的人帮助我。
编辑:我忘了提及这是针对 iOS 应用程序的,并且我正在使用最新的 Facebook iOS SDK(支持扩展令牌)。用户登录后,我正在调用 extendAccessToken
方法,但我仍然收到一个将在 2 小时内过期的 accessToken。
** Looks like this was a bug that Facebook has since fixed.
I disabled offline_access
so that I could get extended access tokens without asking for the offline_access
permission.
While testing, it seemed to work fine at first. I got a token that expired in 60 days. Then I removed the app from facebook's app settings so I could test. As soon as I removed it, I started getting tokens that expire in 2 hours.
Is this a bug? Or maybe this is a security thing like as soon as the app is removed, a flag is set not allowing extended tokens? Someone from Facebook please help me.
Edit: I forgot to mention that this is for an iOS app and I'm using the latest Facebook iOS SDK (which has support for extending the token). After getting the user logs in, I'm calling the extendAccessToken
method but I'm still getting back an accessToken that expires in less than 2 hours.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的应用程序需要,您应该获取 2 小时令牌并将其转换为 60 天令牌。
You're supposed to take that 2 hour token and convert it into a 60 day one if your app needs it.
看起来这是 Facebook 已经修复的一个错误。
Looks like this was a bug that Facebook has since fixed.
如果您在developers.facebook.com上将应用程序的高级设置中的应用程序类型设置为“Native/Desktop”而不是Web,则
extendAccessToken
方法当前返回一个令牌,该令牌将在 1 天左右过期,而不是仅 2 小时。我希望有一种方法可以延长有效期,但到目前为止还没有运气。
It seems if you set your app type in the Advanced Setting of your app at developers.facebook.com to "Native/Desktop" instead of Web, the
extendAccessToken
method currently returns a token that expires in around 1 day instead of just 2hrs.I'm hoping there's a way to get a longer expiry than that, but no luck so far.