hello I've seen that the access token has a correct life time?
to test a certain code
oauth2client.on('tokens', (tokens) => {
if (tokens.refresh_token) {
// store the refresh_token in my database!
console.log(tokens.refresh_token);
}
console.log(tokens.access_token);
});
to test it I'm sending a request to a google API (spreadsheet), with all the required authentication data, the only thing that changed is access_token as null, so you would get an answer as if you had sent an access_token expired.
But the surprise is, it returns a 200 status code, and performs the operation normally.
Aye, that will work fine :) The way google-auth-library works is that if you set the refresh_token, it will auto-magically acquire an access token if one is not present, or if the access_token it has is expired. So yes - we update the access_token for you automatically :) Hope this answers your question!
wow how amazing, thanks for clarifying.
Most helpful comment
Aye, that will work fine :) The way
google-auth-libraryworks is that if you set therefresh_token, it will auto-magically acquire an access token if one is not present, or if the access_token it has is expired. So yes - we update the access_token for you automatically :) Hope this answers your question!