modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Implement OAuth 2.0 Authorization Code flow with PKCE (RFC 6749 + RFC 7636)
オープン
まだ誰も着手していません。
auth
Client
enhancement
improves spec compliance
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず依存関係 #315、#316、#317、#318 を確認し、次に Mcp\Client\Auth\Grant\AuthorizationCodeGrant と TokenStorageInterface を調査します。user-agent と redirect-handler の統合を定義する前に、認可エンドポイントとトークンエンドポイントを追跡します。PKCE と state 検証のユニットテストに合格し、auth/basic-cimd 適合シナリオに合格すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- authentication
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100