[Client] Implement OAuth scope handling (WWW-Authenticate, scopes_supported, step-up, retry-limit, omitted)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- php
- Domain
- api, authentication
Research direction
Start with Mcp\Client\Auth\ScopeResolver and AuthCoordinator, then inspect WwwAuthenticateParser and the five named conformance scenarios. Verify each scope-resolution path, including omitted scopes, and confirm that insufficient_scope step-up retries are limited to one; the unit tests and all five baseline scenarios should pass.
Written by the indexing model from the issue text.
Description
Context
Five baseline scenarios cover scope acquisition strategies the client must follow when constructing authorize/token requests:
auth/scope-from-www-authenticate— parsescope="<list>"fromWWW-Authenticateinsufficient_scope challenges and request those scopes on next authorize.auth/scope-from-scopes-supported— when no challenge hint, fall back toscopes_supportedfrom AS metadata.auth/scope-omitted-when-undefined— when neither source provides scopes, omit thescopeparameter entirely (do not send empty string).auth/scope-step-up— on403/401witherror=insufficient_scope, restart auth flow requesting the augmented scope set.auth/scope-retry-limit— bound step-up retries to one to prevent infinite loops.
Scope
Mcp\Client\Auth\ScopeResolverconsulted byAuthCoordinatorbefore every authorize/token request.WwwAuthenticateParserreturningscope,error,error_description,resource_metadata.- Step-up retry counter held in
AuthCoordinatorstate.
Conformance scenarios unblocked
All 5 scope scenarios above.
Dependencies
Blocked by: #316 (401 plumbing), #318 (AS metadata), #319 (Auth Code flow).
Acceptance
- Unit tests per resolution path.
- Conformance: 5 baseline scenarios pass.
cc @soyuka
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/php-sdk
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan OpenServer
Difficulty 1/5 Under an hour Newbie friendliness 78/100
modelcontextprotocol/php-sdk#468 · 2 comments ·
-
needs confirmation needs maintainer action Server
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#398 · 1 reaction ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
modelcontextprotocol/php-sdk#510 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
modelcontextprotocol/php-sdk#504 ·
All issues in modelcontextprotocol/php-sdk
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·