Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oleks9o6
marked this pull request as ready for review
October 28, 2026 15:33
Collaborator
|
I think we need some additional documentation on how errors are handled now, either by adding to the authorise endpoint page or creating a dedicated error handling page? @patchandthat thoughts |
This branch has not been deployed
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.
Description
Adds
IdentityServerOptions.StrictAuthorizeErrorResponses, off by default. When it's on, the authorize endpoint sends an error back to the client's redirect URI whenever the redirect URI and response mode have already been validated, as RFC 6749 section 4.1.2.1 describes, instead of showing the error page. With the option off, behaviour is unchanged.What that means for the codes in the issue:
invalid_requestandunauthorized_clientfrom the checks that run after the redirect URI is validated (response type, response mode, PKCE, prompt and the other parameters), andinvalid_scope. Alsounmet_authentication_requirements,server_errorandtemporarily_unavailablewhen an extension such as the interaction response generator returns them.invalid_target(RFC 8707) reaches the client too.invalid_request_object,invalid_request_uriandrequest_uri_not_supporteddon't reach the client. A missing or unknownresponse_typealso stays on the error page, because the response mode isn't known yet.request_not_supportedorregistration_not_supporteditself. If an extension does, they reach the client like any other error.Closes #137
Type of change
Does this PR introduce a breaking change?
Does the change cause a breaking change to any of the following?
Testing
New
AuthorizeResultunit tests cover the option off, the option on, and the option on without a validated redirect URI or response mode. Without the option check, the redirect URI and response mode check, or the new condition as a whole, the matching tests fail. The full unit and integration suites pass.LLM Usage
The
src/changes are written by me. The tests and theoptions.rstentry were drafted with Claude and reviewed by me.Other context
Question: do you want the request object errors to reach the client as well? The validator checks the request object before the client's redirect URI, because the request object can carry the redirect URI. Returning
invalid_request_objectto the client would mean checking the plainredirect_uriquery parameter against the already loaded client when the request object fails, and choosing a response mode. That changes the validator, so I've left it out. I'm happy to add it here or in a follow-up if you'd like it.With the option on, error codes from custom extensions also go back to the client. That's what section 4.1.2.1 describes, which returns any failure once the redirect URI is valid. If you'd rather limit it to the codes the specs define, that's a small change.
For comparison, Duende IdentityServer returns
temporarily_unavailableandunmet_authentication_requirementsto the client by default. This PR keeps the current default, as the issue asks.🤖 Generated with Claude Code