[Client] Implement refresh_token grant + offline_access scope

オープン
#323 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
php

調査の方向性

Mcp\Client\Auth\Grant\RefreshTokenGrant から始め、access/refresh token と scope の処理フローについて依存関係 #319 と #322 を確認してください。認証の適合性シナリオ auth/offline-access-scope と auth/offline-access-not-supported を実行し、その後、プロアクティブおよびリアクティブな refresh、degradation、そしてクリーンな再認証のために要求されている単体テストのカバレッジを追加してください。

索引モデルが issue の本文から書いたものです。

説明

auth Client enhancement improves spec compliance

Context

When an access token expires, the client must transparently refresh using the stored refresh_token rather than re-prompting the user. Per OIDC/OAuth, offline_access scope is requested at authorize time when the AS advertises it; otherwise the client degrades gracefully (no refresh available).

Scope

  • Mcp\Client\Auth\Grant\RefreshTokenGrant.
  • Pre-flight check: if expires_at - now() < skew, refresh before sending request.
  • Reactive: on 401 with valid refresh token, refresh + retry once.
  • Request offline_access scope at authorize time when scopes_supported contains it; otherwise omit.
  • If the AS does not advertise offline_access and tokens expire, surface a re-auth signal cleanly (no infinite loop).

Conformance scenarios unblocked

auth/offline-access-scope, auth/offline-access-not-supported.

Dependencies

Blocked by: #319 (need access+refresh tokens from auth code flow), #322 (scope handling).

Acceptance

  • Unit tests for proactive + reactive refresh, no-refresh-token degradation, no-offline_access degradation.
  • Conformance: 2 baseline scenarios pass.

cc @soyuka

主要言語
PHP
スター
1.6k
フォーク
173
平均マージ
2日 49分
マージ済み PR(30日)
23

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/php-sdk のほかの issue

modelcontextprotocol/php-sdk の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。