OAuth2 Discovery method fails because FastMCP with GoogleProvider (OAuth) returns issuerUrl with trailing slash
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从 issue 中链接的 src/google/adk/auth/oauth2_discovery.py 里的 OAuth2DiscoveryManager.discover_auth_server_metadata 开始,检查返回的 issuer 如何与提供的 URL 进行比较。复现带有尾部斜杠的 discovery 响应,并验证返回了匹配的元数据;当 FastMCP 风格的 issuer URL 不再导致 discovery 失败时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The OAuth2DiscoveryManager.discover_auth_server_metadata function retrieves a remote MCP Server's discovery document, to initialize the tool's AuthScheme object.
The function compares the returned issuer URL to the provided issuer URL to defend against MIX-UP attacks (as documented):
if metadata.issuer == issuer_url.rstrip("/"):
However, if the returned issuer has a trailing slash ('/'), as is the case when using FastMCP and the GoogleProvider, the function fails to compare the issuer values and no metadata is returned.
The correct code should be:
if metadata.issuer.rstrip("/") == issuer_url.rstrip("/"):
This is an example of what FastMCP is returning when using SSE transport with a GoogleProvider:
{
"issuer": "http://localhost:8080/",
"authorization_endpoint": "http://localhost:8080/authorize",
"token_endpoint": "http://localhost:8080/token",
"registration_endpoint": "http://localhost:8080/register",
"scopes_supported": [
"openid",
"https://www.googleapis.com/auth/userinfo.email"
],
"response_types_supported": [
"code"
],
"grant_types_supported": [
"authorization_code",
"refresh_token"
],
"token_endpoint_auth_methods_supported": [
"client_secret_post",
"client_secret_basic",
"private_key_jwt",
"none"
],
"code_challenge_methods_supported": [
"S256"
],
"client_id_metadata_document_supported": true
}
- 主要语言
- Python
- 星标
- 21.6k
- 派生
- 4k
- 平均合并
- 7 小时 10 分钟
- 30 天内合并 PR
- 7
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7266 · 1 条评论 ·
-
mcp
难度 2/5 1-3 小时 新手友好度 75/100
google/adk-python#7217 · 3 条评论 · 已指派 1 人 ·
-
tools
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7206 · 1 条评论 · 已指派 1 人 ·
-
request clarification tools
难度 2/5 1-3 小时 新手友好度 86/100
google/adk-python#7205 · 2 条评论 · 已指派 1 人 ·
-
mcp request clarification
难度 2/5 1-3 小时 新手友好度 78/100
google/adk-python#7196 · 2 条评论 · 已指派 1 人 ·
查看 google/adk-python 的全部 Issue
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100