Facebook令牌Android SDK刷新条件 [英] Facebook token Android SDK refresh criteria

查看:81
本文介绍了Facebook令牌Android SDK刷新条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望了解长期访问令牌的Facebook刷新周期(60天)。

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

尽管他们的文档表示

如果我在获取访问令牌后的第二天调用图'/ me',则令牌的有效期将被更新或扩展

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

,但事实并非如此。我尝试通过其Android SDK查询/ me端点,但令牌有效期未更新。

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

我遇到了类似的问题Facebook:在Android上刷新AccessToken ,但该建议对我不起作用。

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

Ps::很乐意共享代码,但我怀疑这是必需的。

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.

推荐答案

您链接的文档的第一行状态:

The first line in the document you linked states:


Facebook的官方SDK为您管理令牌的生命周期。当
使用iOS,Android或我们的JavaScript SDK时, SDK将处理
确保令牌在令牌过期之前被刷新。

如果您通读了文档,就会发现如果用户使用该应用程序,SDK将每天刷新令牌。如果用户在60天之内未使用过令牌,则必须再次登录以获取新令牌。

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?

这篇关于Facebook令牌Android SDK刷新条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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