ClientRegistrations: an opt-in fromIssuerLocation that reads RFC 8414 first, for MCP clients
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start with ClientRegistrations.fromIssuerLocation and the discovery URL logic it uses, to see how the OpenID Connect and RFC 8414 documents are fetched and parsed in order. The proposal adds a separate fromOAuth2IssuerLocation that tries RFC 8414 first and moves on after a 200 that fails to parse or names another issuer, leaving the existing method unchanged. Done means the new method passes tests for both reported cases, with the existing tests still green. The maintainers have not yet decided whether this should be added at all, so confirm that before writing code.
索引モデルが issue の本文から書いたものです。
説明
Problem
ClientRegistrations.fromIssuerLocation(issuer) reads the OpenID Connect document first, then the RFC 8414 document. MCP clients must read RFC 8414 first (MCP authorization spec, 2025-11-25). When the two documents differ, an MCP client gets the wrong one.
Two real cases:
- Clerk (
https://clerk.higgsfield.ai): the OIDC document has noregistration_endpoint. The RFC 8414 document has one. Dynamic client registration fails. https://api.getprospect.com: the OIDC document answers 200 but is not valid OIDC metadata (nojwks_uri).fromIssuerLocationthrows on the parse error and never reads the valid RFC 8414 document.
Proposal
Add an opt-in method that tries the RFC 8414 URL first. It fixes both cases. fromIssuerLocation does not change.
/**
* Same as {@link #fromIssuerLocation(String)}, but tries the RFC 8414 endpoint first, as the
* <a href="https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#authorization-server-metadata-discovery">MCP authorization spec</a>
* requires.
*/
public static ClientRegistration.Builder fromOAuth2IssuerLocation(String issuer) {
Assert.hasText(issuer, "issuer cannot be empty");
return getBuilder(issuer, oauth(issuer), oidcRfc8414(issuer), oidc(issuer));
}
If you agree, I can send a PR with tests.
Related
- spring-ai-community/mcp-security#23: the same OIDC-first order in resource-server discovery. A 200 HTML page at
/.well-known/openid-configurationstops it. - #19342: MCP discovery order on the authorization-server side.
Our workaround
We shadow ClientRegistrations with a copy of the 7.1.2 source, with this order change, and pin it to 7.1.2 with a test.
(issue generated with AI assistance)
- 主要言語
- Java
- スター
- 9.7k
- フォーク
- 6.4k
- 平均マージ
- 3時間 11分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-projects/spring-security のほかの issue
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
spring-projects/spring-security#20057 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-projects/spring-security#20056 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-projects/spring-security#20055 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
spring-projects/spring-security#20054 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
spring-projects/spring-security#20053 ·
メンテナーはふだん 1 日以内に返信
spring-projects/spring-security の issue をすべて見る
似ている issue
-
jules
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-learning-exchange/myplanet#18568 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quarkiverse/quarkus-ironjacamar#264 · コメント 7 件 ·
-
[Bug]: Login shows only "Log-in failed" when Commons answers the login request with an API errorオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
commons-app/apps-android-commons#7295 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
hibernate/hibernate-reactive#4485 ·
メンテナーはふだん 1 日以内に返信