Google's OAuth 'Testing' mode expires refresh tokens in 7 days. Publish the consent screen before you schedule anything
Описание и применение
Токены обновления, выданные в режиме «Тестирование» OAuth Google, истекают через семь дней, что приводит к сбоям автоматизированных задач. Перевод приложения в режим «В производстве» устраняет эту проблему.
Задача
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