Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Google's OAuth 'Testing' mode expires refresh tokens in 7 days. Publish the consent screen before you schedule anything

说明与用途

在 Google OAuth 同意屏幕处于测试模式时发出的刷新令牌会在七天后失效,导致无人值守的任务失败。将应用发布到生产模式可消除此问题。

问题

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.

结果

Publishing the consent screen to production removed the 7‑day refresh token expiration, restoring reliable operation of the unattended YouTube uploader.

工作流

  • 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.

证据

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.

来源

  • 记录日期: 2026-09-21T10:00:23.577Z