I have been trying to create a refresh token since the access token keep on expiring in 1hr.
window.onload = function () {
google.accounts.id.initialize({
client_id: ,
callback: handleCredentialResponse,
});
google.accounts.id.renderButton(
document.getElementById("google-signin-button"),
{ theme: "outline", size: "large", shape: "circle" } // customization attributes
);
google.accounts.id.prompt(); // also display the One Tap dialog
};
In this doc from google nothing is mentioned about create a refresh token. https://developers.google.com/identity/gsi/web/guides/overview
Anyone help me out thanks.
Sign-inor authentication is login and returns and id token and an access token, and identifies the user behind the machine.Oauth2is authorization and returns an access token and refresh token granting your application access to a users data.Signin will not return a refresh token.
If you read further on the page you linked you will fined a section intitled Separated Authentication and Authorization Moments
Solution to your issue is to use Google Identity Services authorization API instead of signin to authorize a user using Oauth2.