Publish Google Cloud OAuth app to eliminate 7-day token expiry and 1-hour access token limit #261
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform#261
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Standalone — recurring blocker across every session that uses Gmail. Token expired 5 times in the 2026-04-03/04 session alone, blocking email sends each time.
Repo
forgejo_admin/pal-e-platform(platform-level, affects all services using Gmail OAuth)What Broke
Gmail OAuth tokens expire every hour (access token) and every 7 days (refresh token) because the Google Cloud OAuth app is in Testing mode. This forces manual re-auth via browser every time the token expires, blocking all email operations.
Impact:
gmail-reauth.shscript and Prometheus alerts (6-day/7-day) are bandaids, not fixesRoot cause: Google Cloud project
gmail-oauth-486921has an unpublished OAuth consent screen. Google policy for unpublished/testing apps:refresh_token_expires_in: 604799in the token file confirms Testing modeRepro Steps
gmail_reauth_start+gmail_reauth_complete)Expected Behavior
Auth once, tokens auto-refresh indefinitely. The gmail-sdk already has auto-refresh logic (
auth.py:157-179) that works correctly when the refresh token is valid.Environment
gmail-oauth-486921233869493443-e81l55kmgjm21jl7n8jm9pnjodgatv1a.apps.googleusercontent.com~/secrets/google-oauth/gmail-westsidebasketball.json~/gmail-mcp/usinggmail-sdkfor token managementFile Targets
No code changes. This is a Google Cloud Console configuration change.
Steps:
gmail-oauth-486921)gmail_reauth_start/gmail_reauth_completerefresh_token_expires_inis no longer 604799 (7 days)Post-publish:
~/secrets/google-oauth/gmail-westsidebasketball.json— will contain long-lived refresh tokengmail-oauth-westsidebasketballin basketball-api namespace — update from localAcceptance Criteria
refresh_token_expires_inis NOT 604799 in the token filesop-gmail-oauthcreated documenting the permanent fixGmailOAuthTokenExpiringSoon/GmailOAuthTokenExpiredstop firingTest Expectations
gmail_get_profilesucceeds after access token expiry without manual reauthConstraints
gmail-oauth-486921Checklist
Related
pal-e-platform— project this affectsscripts/gmail-reauth.sh— current bandaid (PR #222)terraform/modules/monitoring/main.tf— Prometheus alerts for token expiry