Sign In With Google: refresh token in background

Viewed 88

How Do I refresh auth token when using Sign In With Google?

With "Sign In With Google" it seems the user has to confirm being logged in every 30 minutes. 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:

Sign In With Google JavaScript API reference .

2 Answers

With the new "Sign in with Google" system, Google only handles the original authentication. 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>
Related