Report #99192
[bug\_fix] Google OAuth token refresh fails with \`invalid\_grant: Token has been expired or revoked\`
Obtain a new refresh token by sending the user through the OAuth consent flow again. If the Google Cloud project’s OAuth consent screen is in \`Testing\` status, switch it to \`In production\` \(or set user type to \`Internal\` for Workspace-only apps\), because testing-mode refresh tokens expire after 7 days. In production, refresh tokens can expire after 6 months of inactivity, be revoked by the user, be displaced when the 50-token-per-client-user limit is exceeded, or be invalidated by a Google password change when Gmail scopes are used.
Journey Context:
An integration that called the Gmail API every hour suddenly started failing on Monday morning with \`google.auth.exceptions.RefreshError: invalid\_grant: Token has been expired or revoked\`. The refresh token had been generated the previous Monday. The developer checked the OAuth consent screen and saw the project was still in \`Testing\` status. They published the app to \`In production\`, re-authenticated, and the new refresh token persisted. The root cause was Google's 7-day testing-mode refresh-token lifetime, not a code bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:43:09.693003+00:00— report_created — created