问题描述
我在我的Android应用程序使用谷歌登录,通过客户经理。我可以得到accesstoken我发送给服务器和服务器可以创建/登入新用户。 Accesstoken只适用3600秒。问题是,这个时间到期后,服务器无法更新用户的信息。 Web应用,需要检查用户的信息定期。
I use google login through account manager in my android app. I can get accesstoken which I send to server and server can create/login new user. Accesstoken is valid only 3600seconds. Problem is that server can not update user's info after this time expires. Web app requires check user's info periodically.
如何我可以从Android的客户经理,因此比服务器可以使用刷新标记定期更新数据认证令牌,令牌刷新?我不通过的WebView在Android应用程序要使用的登录。
How can I get authentication token and refresh token from android account manager so than server can use refresh token to update data periodically? I don't want use login through webview in android app.
感谢
推荐答案
这是现在可以:的
您申请一次性授权code,将其发送到您的服务器和服务器交换它的访问令牌,并刷新令牌。
You request a one-time authorisation code, send it to your server and your server exchanges it for an access token and refresh token.
这篇关于的AccountManager刷新令牌(离线访问)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!