Facebook token Android SDK refresh criteria

佐手、 提交于 2019-12-11 09:57:26

问题


I wished to understand the facebook refresh cycle for the long term access token (60 days).

Although their doc implies

If I make a graph '/me' call a day after obtaining the access token, the token expiry would be updated or extended

but the same isn't the case. I tried querying the /me endpoint via their android SDK but the token expiry wasn't updated.

I came across a similar question Facebook: refresh AccessToken on Android but the suggestion didn't work for me.

Ps: Would be happy to share code but I doubt that is needed.

-------EDIT------

My use case involves only authentication at the client end , followed up with submitting the token to my server. This token is periodically used by my server to fetch updated user info. In order to accomplish this I need to ensure that the token never expires at the client. I don't wish to relogin the user on token expiry as far as possible.


回答1:


The first line in the document you linked states:

Facebook's official SDKs manage the lifetime of tokens for you. When using iOS, Android or our JavaScript SDK, the SDK will handle making sure that tokens are refreshed before they expire.

If you read through the documentation, you can see that if the user uses the app, the SDK will refresh your token daily. If the user has not used it in 60 days, then he has to log in again to get a new token.

Altogether, no action is required on your side for refreshing the token manually. Why do you think you have to refresh the token?



来源:https://stackoverflow.com/questions/33497021/facebook-token-android-sdk-refresh-criteria

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