I've got a problem with Google API and refresh token.
return axios.post("https://accounts.google.com/o/oauth2/token", {
client_id: clientId,
client_secret: clientSecret,
refresh_token: querystring.unescape(refresh_token),
grant_type: "refresh_token",
})
.then((response) => {
return response.data.access_token;
})
.catch((err) => console.log("error GetTokenWithRefresh: ", err.response))
This works fine. I get my new token. (I use this request for tests each time I need to write into excel document). But after a certain time, my refresh_token becomes invalid
{
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}
My google account used to grant access to app is far under the limit of refresh tokens. It still has app in authorised applications in security on my Google account. It's as if the refresh_token had the same behavior as a classic token.
If you have any idea where the problem may be coming from, I would be very grateful!
Have a nice day !