kellpossible / email-weather

A plain text weather forecasting service via email
https://kellpossible.github.io/email-weather/
GNU Affero General Public License v3.0
1 stars 0 forks source link

Error while refreshing OAUTH2 token #11

Closed kellpossible closed 2 years ago

kellpossible commented 2 years ago
ERROR receive_emails: email_weather::task:
0: Error obtaining OAUTH2 access token
1: Error while refreshing token
2: Error while exchanging refresh token
3: Server returned error response:
{
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}

Location:
/email-weather/src/oauth2.rs:119

This issue appears to be related to https://stackoverflow.com/questions/66058279/token-has-been-expired-or-revoked-google-oauth2-refresh-token-gets-expired-i

kellpossible commented 2 years ago

It looks according to https://support.google.com/cloud/answer/10311615#zippy=%2Ctesting

Authorizations by a test user will expire seven days from the time of consent. If your OAuth client requests an offline access type and receives a refresh token, that token will also expire.

However when switching the consent screen for email-weather to production it says that it requires verification! I don't really want to verify my app because this will only be used for my personal account, it doesn't make any sense to require verification for this purpose.

Perhaps I should switch to a different form of OAUTH for this application, maybe "device" or "service account", instead of "installed"?

kellpossible commented 2 years ago

It also looks like OOB for "installed" flow is also deprecated: https://developers.google.com/identity/protocols/oauth2/resources/oob-migration