{"version":"2.1.324","anchor":"oauth-401-recovery-sdk-getoauthtoken-callback-gets-a-second","canonical_anchor":"oauth-401-recovery-sdk-getoauthtoken-callback-gets-a-second","heading":"SDK token callback gets a second argument and stricter same-token handling","tier":"notice","area":"SDK","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/oauth-401-recovery-sdk-getoauthtoken-callback-gets-a-second","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### SDK token callback gets a second argument and stricter same-token handling\n\nThe SDK `getOAuthToken` callback now receives a second argument, and returning the same token can now stop sign-in recovery\n\n**Unclear.** It is not clear exactly what the new second argument passed to `getOAuthToken` contains.\n\n**What**\n\nWhen Claude Code runs inside another program through the SDK (the toolkit for building on Claude Code), that program can hand over sign-in tokens through a `getOAuthToken` callback. A token is the credential that proves you are signed in. Claude Code calls this callback to get a fresh one after a server refuses the current token with a 401 error.\n\nWhat changed:\n\n- `getOAuthToken` is now called with a second argument describing the request.\n\n- Returning the same token is still accepted without error when the 401 was marked stale, or when an extra check passes.\n\n- Otherwise, returning the same token now ends the recovery attempt, and it reports failure.\n\n**Why**\n\nThis matters if you build on the SDK and supply tokens through this callback. A callback that hands back the same token after a refusal may now cause recovery to fail rather than continue.\n\n- Area: SDK\n- Names: `getOAuthToken`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}