Skip to content

fix(shared): show the provider's reason when an OIDC token request fails - #1

Closed
flvvius wants to merge 1 commit into
TuroYT:t3/self-hosted-connect-servicefrom
flvvius:fix/oidc-token-error-description
Closed

flvvius wants to merge 1 commit into
TuroYT:t3/self-hosted-connect-servicefrom
flvvius:fix/oidc-token-error-description

Conversation

@flvvius

@flvvius flvvius commented Nov 18, 2026

Copy link
Copy Markdown

Problem

While testing pingdotgg#34302 (pingdotgg/t3code) against Microsoft Entra ID, the first web sign-in ended on "The token request failed with 400." and nothing else. requestTokens keeps the provider's error only as oauthError, and the callback page shows neither that nor error_description. So a misconfigured app registration (for Entra, the redirect URI under the wrong platform type) looks exactly like a bug, and the only way to find out which is DevTools.

Change

A failed token request now puts the provider's error_description in the message, or its error code when there is no description: "The token request failed with 400: AADSTS…". When the body has neither, the message is the same as before. status and oauthError are unchanged, so isPermanentRefreshFailure behaves as before.

Scope

A small fix to this branch's OIDC client, from the findings in my test report on pingdotgg#34302. The CLI device flow already shows the provider's text, which is how the second misconfiguration in that test was diagnosed in one try.

Verification

  • Extended the existing "tells a rejected refresh apart from a temporary failure" case in packages/shared/src/oidc.test.ts. It fails on the branch head (2239610) and passes with the fix.
  • vp test run packages/shared/src/oidc.test.ts packages/client-runtime/src/relay/oidcController.test.ts: 36 passed.
  • check:changed against the branch head: format, lint, knip and typecheck (36 packages) pass. It also runs apps/server/src/provider/AgentContextBudget.test.ts, which fails to load on my machine with or without this change ("Vitest failed to find the current suite"), so that failure is unrelated.

Done with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

A rejected token request only reported the HTTP status ("The token request
failed with 400."), so a misconfigured app registration looked the same as a
bug. Include the provider's error_description, or its error code, in the
message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S labels Nov 18, 2026
@flvvius

flvvius commented Nov 19, 2026

Copy link
Copy Markdown
Author

Closing: b8787c3 on the PR branch already shows the provider's reason on token errors. Thanks!

@flvvius flvvius closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant