{
  "id": 3957213,
  "title": "My OAuth Tokens Kept Expiring Every 7 Days, and the Reason Was a Dropdown Labeled 'Testing'",
  "url": "https://urgent.news/2026/08/28/my-oauth-tokens-kept-expiring-every-7-days-and-the-reason-was-a",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-28T12:02:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/just_a_side_project/my-oauth-tokens-kept-expiring-every-7-days-and-the-reason-was-a-dropdown-labeled-testing-47ni"
  },
  "original_language": "en",
  "account": "My OAuth tokens kept expiring every seven days, despite no changes to the setup or the app's usage. The issue persisted even after fixing a different bug and verifying that the token file remained untouched. The root cause was discovered in the OAuth consent screen: the \"Testing\" setting in Google Cloud's Google Auth Platform restricted refresh tokens to a maximum of seven days, regardless of usage. To resolve the problem, the Publishing status was switched from \"Testing\" to \"In production,\" which allowed refresh tokens to maintain a longer lifespan. Additionally, the script was updated to catch refresh failures explicitly, providing a clearer error message and preventing silent failures. This change ensured that future OAuth-related issues would be more easily identifiable and manageable.",
  "summary": "Three weeks into running my publishing pipeline on autopilot, it just stopped. Not with a crash -- with the exact same error I'd already spent a week debugging and fixing once before: invalid_grant: Token has been expired or revoked . Same message, same script, same working setup. I assumed I'd broken my own fix. I hadn't. This was a completely different bug wearing the same disguise, and it had…",
  "key_points": [
    "OAuth tokens expired every 7 days due to Testing setting",
    "Testing in Google Auth Platform restricted refresh tokens",
    "Switched Publishing status to In production to resolve"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}