[Client] Implement OAuth 2.0 Authorization Code flow with PKCE (RFC 6749 + RFC 7636)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- php
- Domain
- authentication
Research direction
Start by reviewing dependencies #315, #316, #317, and #318, then inspect Mcp\Client\Auth\Grant\AuthorizationCodeGrant and TokenStorageInterface. Trace the authorization and token endpoints before defining the user-agent and redirect-handler integration. Done means PKCE and state-validation unit tests pass and the auth/basic-cimd conformance scenario passes.
Written by the indexing model from the issue text.
Description
Context
Primary user-facing flow. Required for any interactive MCP client to obtain tokens after PRM/AS discovery.
Scope
Mcp\Client\Auth\Grant\AuthorizationCodeGrant:- Generate PKCE
code_verifier+code_challenge(S256). - Build authorize URL with
client_id,redirect_uri,response_type=code,code_challenge,code_challenge_method,scope,state,resource(audience-binding RFC 8707). - Pluggable user-agent dispatcher: callback hook so library users can open a browser / present URL in CLI.
- Local loopback redirect listener (default) or custom redirect handler.
- Exchange code → tokens at
token_endpoint; persist viaTokenStorageInterface.
- Generate PKCE
- Verify
stateround-trip; reject mismatched.
Conformance scenarios unblocked
auth/basic-cimd and prerequisite for all scope/refresh/cross-app scenarios.
Dependencies
Blocked by: #315, #316, #317, #318. Pairs with #319 (token endpoint auth methods).
Acceptance
- Unit tests for PKCE generation + state validation.
- Conformance:
auth/basic-cimdpasses.
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
-
status/awaiting_triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
az-digital/az_quickstart#6019 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
grokability/snipe-it#19688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100