简体   繁体   English

使用 Google 登录:在后台刷新令牌

[英]Sign In With Google: refresh token in background

How Do I refresh auth token when using Sign In With Google?使用 Google 登录时如何刷新身份验证令牌?

With "Sign In With Google" it seems the user has to confirm being logged in every 30 minutes.使用“使用 Google 登录”,用户似乎必须每 30 分钟确认一次登录。 Unfortunately, this often happens why interacting with the website.不幸的是,这经常发生为什么与网站交互。 This frustrates users and cause recent changes not to be saved.这会让用户感到沮丧,并导致无法保存最近的更改。

This wasn't a problem with the old library where it was possible to refresh the token in background.对于可以在后台刷新令牌的旧库,这不是问题。 How to do token refresh with the new library?如何使用新库进行令牌刷新?

It seems there is no API for that:似乎没有API:

Sign In With Google JavaScript API reference . 使用 Google JavaScript API 参考登录

With the new "Sign in with Google" system, Google only handles the original authentication.使用新的“使用 Google 登录”系统,Google 只处理原始身份验证。 It is not intended to manage a user session and you are required to do that yourself/in some other way.它并非旨在管理用户会话,您需要自己/以其他方式执行此操作。

Have you enabled Automatic sign-in您是否启用了自动登录

<div id="g_id_onload"
     data-client_id="YOUR_GOOGLE_CLIENT_ID"
     data-auto_select="true"
     data-login_uri="https://your.domain/your_login_endpoint">
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM