After disabling offline_access and removing the app from app settings I no longer get an extended access token

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 06:40:42

问题


** 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.


回答1:


You're supposed to take that 2 hour token and convert it into a 60 day one if your app needs it.




回答2:


Looks like this was a bug that Facebook has since fixed.




回答3:


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.



来源:https://stackoverflow.com/questions/9184373/after-disabling-offline-access-and-removing-the-app-from-app-settings-i-no-longe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!