ClientRegistrations: an opt-in fromIssuerLocation that reads RFC 8414 first, for MCP clients
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- authentication
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Java
- Star
- 9.7k
- Fork
- 6.4k
- Merge trung bình
- 3 giờ 11 phút
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-projects/spring-security
-
Update spring-ldap to 4.0.7Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
spring-projects/spring-security#20057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update micrometer to 1.16.9Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
spring-projects/spring-security#20056 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update spring-ldap to 4.1.3Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
spring-projects/spring-security#20055 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update micrometer to 1.17.3Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
spring-projects/spring-security#20054 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update spring-ldap to 4.2.0Đang mởtype: dependency-upgrade
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
spring-projects/spring-security#20053 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-projects/spring-security
Issue tương tự
-
jules
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-learning-exchange/myplanet#18568 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
quarkiverse/quarkus-ironjacamar#264 · 7 bình luận ·
-
[Bug]: Login shows only "Log-in failed" when Commons answers the login request with an API errorĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
commons-app/apps-android-commons#7295 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
hibernate/hibernate-reactive#4485 ·
Maintainer thường phản hồi trong vòng 1 ngày