fix(server): return invalid_scope for a scope the client isn't allowed - #403
Merged
Merged
Conversation
The pushed authorization request and backchannel authentication endpoints answered a scope the client isn't registered for (or openid under OAuthOnly) with invalid_request, while client_credentials already used invalid_scope. RFC 6749 §4.1.2.1 and §5.2, which RFC 9126 §2.3 defers to, and CIBA Core §13 all define invalid_scope for a requested scope that is "invalid, unknown, or malformed". A missing or non-string scope is a malformed request and stays invalid_request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
osanderson
force-pushed
the
fix/invalid-scope-error-code
branch
from
September 27, 2026 15:10
02a816b to
e1fd3f7
Compare
osanderson
marked this pull request as ready for review
September 27, 2026 15:10
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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.



Summary
The PAR and CIBA backchannel-authentication endpoints answered a scope the client isn't allowed (an unregistered scope, or
openidunderConfig.OAuthOnly) withinvalid_request.client_credentialsalready usedinvalid_scopefor the same check.invalid_scopefor a requested scope that is "invalid, unknown, or malformed".invalid_scopefor the backchannel authentication endpoint.Both sites now return
invalid_scope. A missing scope (CIBA) or a non-string scope in a request object is a malformed request and staysinvalid_request.Conformance impact: none. The OIDF suite (checked at
4bfcdf8) never sends a PAR or CIBA request with a disallowed scope.Testing
openid, at PAR and CIBA) now expectinvalid_scope. The CIBA table keepsinvalid_requestfor the missing and non-string cases.fapitest's end-to-end PAR test (from feat(client): expose the server's OAuth error response on client.Error #402) now expectsinvalid_scopefrom the real server.go test -raceon server, fapitest and cmd, plusgolangci-lint, are clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01GMAyPYDPGpfnwow3JLeooZ