Repository navigation
Conversation
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>
Author
|
Closing: b8787c3 on the PR branch already shows the provider's reason on token errors. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
requestTokenskeeps the provider'serroronly asoauthError, and the callback page shows neither that norerror_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_descriptionin the message, or itserrorcode when there is no description: "The token request failed with 400: AADSTS…". When the body has neither, the message is the same as before.statusandoauthErrorare unchanged, soisPermanentRefreshFailurebehaves 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
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:changedagainst the branch head: format, lint, knip and typecheck (36 packages) pass. It also runsapps/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