[Client] Implement client_credentials grant (client_secret_basic + private_key_jwt)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- php
- 領域
- api, authentication, security
調査の方向性
まず、token_endpoint の #318 と auth methods の #321 にあるブロック中の作業を読み、次に Mcp\Client\Auth\Grant\ClientCredentialsGrant と、ここで示されている Builder OAuth クライアントの設定箇所を調べます。auth/client-credentials-basic と auth/client-credentials-jwt のカバレッジを実行または追加し、fixture の公開鍵に対する検証も含めます。両方の認証形式が単体テストに合格し、JWT 依存関係の判断が PR の説明に記録されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Context
For non-interactive / machine-to-machine MCP clients, the client_credentials grant (RFC 6749 §4.4) is used directly against token_endpoint. Two client authentication shapes are required by conformance:
- Basic:
Authorization: Basic base64(client_id:client_secret)+ bodygrant_type=client_credentials. - JWT assertion (private_key_jwt, RFC 7521/7523): body
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer+client_assertion=<signed JWT>. JWT signed with the client's private key (ES256/RS256),iss+sub=client_id,aud=token_endpoint,jti=random,exp=now+60s.
Scope
Mcp\Client\Auth\Grant\ClientCredentialsGrantwith pluggable assertion signer.- JWT signing: prefer a thin built-in using
openssl_signto avoid heavy deps; if dep is preferred, chooselcobucci/jwt(modern, typed) overfirebase/php-jwt. - Configure via
Builder::setOAuthClient($id, $secret)orBuilder::setOAuthClientWithKey($id, $privateKeyPem, $algorithm).
Conformance scenarios unblocked
auth/client-credentials-basic, auth/client-credentials-jwt.
Dependencies
Blocked by: #318 (token_endpoint), #321 (auth methods).
Acceptance
- Unit tests for both shapes; JWT signing verified against a fixture public key.
- Decision on JWT dep documented in PR description.
cc @soyuka
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/php-sdk のほかの issue
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan オープンServer
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
modelcontextprotocol/php-sdk#468 · コメント 2 件 ·
-
needs confirmation needs maintainer action Server
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/php-sdk#398 · リアクション 1 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
modelcontextprotocol/php-sdk#510 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
modelcontextprotocol/php-sdk#504 ·
modelcontextprotocol/php-sdk の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getgrav/grav-plugin-api#45 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RSS-Bridge/rss-bridge#5098 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
phingofficial/phing#2025 ·