google-oauth

How to update session using implicit flow

Using the implicit flow for google oauth2 it is impossible to refresh the session, as
refresh tokens are not accessible in implicit flow. One can use a listener for expiring sessions
and run GoogleAuth.signIn() or GoogleUser.signIn() methods to refresh the session, but
it will lead to the new window to appear on the client side (in case the user has already grant access,
the window will flash for a moment, and close by itself.)

But…

…Google Sign-in client lib has an undocumented method for refreshing the session inside
the browser:

1
gapi.auth2.getAuthInstance().currentUser.get().reloadAuthResponse()

UPDATE

As it comes, the google client lib automatically refreshes the session in 5 mins to the end of previous session.