Jakub Vala
Jakub Vala

Reputation: 31

Invalid grant error message and invalid tokens after a week

Environment details

Issues

Cloud functions used in application

cloud functions are deployed on GCP functions 1) and 2) are triggered only once on function 3) is set the cron job every hour on function 4) is set the cron job every day

The whole issue with a little bit of explanation an a bit of code is submitted here: github issue

Upvotes: 1

Views: 249

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117281

I can see by the code that you posted on Github that you are using Oauth2 to authorize your users. You are not using service account authentication.

new googleAuth.OAuth2Client({ clientId, clientSecret, redirectUri})

Apps that are in test have their refresh tokens expired after seven days.

To fix it up your application into production.

Refresh token

A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days.

set to prodctuion

go to google cloud console for your project under the oauth2 consent screen

enter image description here

Upvotes: 1

Related Questions