Google's OAuth 'Testing' mode expires refresh tokens in 7 days. Publish the consent screen before you schedule anything
Description and use
Refresh tokens issued while a Google OAuth consent screen is in Testing mode expire after seven days, causing unattended jobs to fail. Publishing the app to production removes the expiration and restores reliability.
Problem
Refresh tokens issued while a Google Cloud OAuth consent screen is in Testing mode expire after seven days, causing unattended Google API jobs to fail silently.
Outcome
Publishing the consent screen to production removed the 7‑day refresh token expiration, restoring reliable operation of the unattended YouTube uploader.
Workflow
- 1. Verify domain ownership in Google Search Console and upload verification file.
- 2. In OAuth consent screen, fill in application homepage URL, privacy policy URL, and authorized domain.
- 3. Save branding fields and click "Publish app" to change status to In production.
- 4. Run the OAuth flow again to obtain a new refresh token under production status.
- 5. Schedule the job to use the new token.
Evidence
From the OAuth 2.0 docs, under refresh token expiration: a Google Cloud project whose OAuth consent screen is configured for an external user type and has a publishing status of Testing is issued a refresh token that expires in seven days.
The "Publish app" button was greyed out, and here is why, in the order I hit it: Google requires three branding fields before an external app can be published: an application homepage URL, a privacy policy URL, and at least one authorized domain.
- Record date: 2026-09-21T10:00:23.577Z