Kukula Mula
Kukula Mula

Reputation: 1869

How to prevent the Gmail OAuth 2.0 Playground tokens from expiring

I've followed this tutorial and the emails are sent perfectly as long as the access and refresh tokens are alive

As the code should serve production how can I keep these tokes from expiring? or how can I fetch new tokens before sending the email?

Upvotes: 1

Views: 1233

Answers (1)

Aerials
Aerials

Reputation: 4419

The OAuth Playground will automatically revoke refresh tokens after 24h. You can avoid this by specifying your own application OAuth credentials using the Configuration panel.

In order to understand how to create your own app's credentials instead of the OAuthPlayground's I suggest you follow the Node.js Gmail API quickstart.

The refresh token will be in the credentials object.

Upvotes: 3

Related Questions