Repository navigation
oauthex: accept an empty quoted-string auth-param value - #1344
Merged
guglielmo-san merged 1 commit intoOct 6, 2026
Merged
guglielmo-san merged 1 commit into
guglielmo-san merged 1 commit into
Conversation
parseSingleChallenge rejected any auth-param whose value was empty, including a quoted-string such as realm="". RFC 9110, section 5.6.4, allows a quoted-string to be empty; only a token must be non-empty. Because ParseWWWAuthenticate fails the whole header on one bad challenge, a server that sent realm="" or error_description="" made AuthorizationCodeHandler.Authorize and the client-credentials handler return "failed to parse WWW-Authenticate header", so the client never reached the resource_metadata parameter and could not authorize. Only reject an empty value when it is unquoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guglielmo-san
approved these changes
Oct 6, 2026
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.
parseSingleChallengerejected any auth-param with an empty value, including a quoted-string such asrealm="". RFC 9110, section 5.6.4, allows a quoted-string to be empty; only a token must be non-empty.ParseWWWAuthenticatefails the whole header when one challenge is malformed, so a server sendingmade
AuthorizationCodeHandler.Authorize(and theextauthclient-credentials handler) returnfailed to parse WWW-Authenticate header. The client never reachedresource_metadataand could not authorize. The same happens with an emptyerror_description="".This moves the empty-value check into the unquoted (token) branch, so
realm=andrealm=, …are still rejected.Tests:
TestParseSingleChallenge: an empty quoted param parses; an empty unquoted value before a comma is still an error.TestParseWWWAuthenticateEmptyQuotedValue: emptyrealmanderror_descriptionno longer hide theresource_metadatathat follows.AI assistance: prepared with Claude Code.