Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

OAuth2 Discovery method fails because FastMCP with GoogleProvider (OAuth) returns issuerUrl with trailing slash

オープン 初心者向け
#7,265 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
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分
マージ済み PR(30日)
7

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

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

はじめの一歩

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

google/adk-python のほかの issue

google/adk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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