Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて

Avatar for watahani watahani
December 23, 2025

Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて

OpenID BizDay #18 ~ AIdentity × Security CollabDay ( https://openid.connpass.com/event/376275/ ) の発表資料です。Authlete を利用して CIMD (Client ID Metadata Document) を含む認可サーバーを実装した結果、見えてきた課題についてまとめています。

Avatar for watahani

watahani

December 23, 2025
Tweet

Other Decks in Technology

Transcript

  1. Copyright © 2025 Authlete, Inc. All Rights Reserved. Copyright ©

    2025 Authlete, Inc. All Rights Reserved. Authlete で実装する MCP OAuth 認可サーバー CIMD 実装してみた Authlete 埴山 遂 (はにやま わたる) 1
  2. Copyright © 2025 Authlete, Inc. All Rights Reserved. 2 •

    OAuth/OIDCリクエスト処理 を代行するAPI • トークン管理のための永続的 ストレージ • 鍵管理やクライアント設定の 一元化 • ユーザーのセルフサービスや 運用を支援する管理API Authlete: OAuth/OIDC化に必要な実装を提供 Resource Owner User Agent Client Authorization Server Resource Server APIリクエスト APIレスポンス イントロスペクション リクエスト イントロスペクション レスポンス アクセス権限確認 認可リクエスト 認可レスポンス トークンリクエスト トークンレスポンス ログインセッション 確認 認証情報照合 アプリにアクセス コンテンツ返却 ユーザー認証 ログイン完了 アプリにアクセス Authlete 認可リクエスト処理 認可レスポンス生成 トークンリクエスト 処理 イントロスペクション リクエスト処理
  3. Copyright © 2025 Authlete, Inc. All Rights Reserved. • AuthleteはFAPI1,

    FAPI2, FAPI-CIBAおよび各国のオープンファイナンスや先進的な OAuth/OIDC 拡張仕様を迅速に実装。 またOpenID Foundationは「OpenID認定プログラム」における「 適合性テスト」開発のテストベッドにAuthleteを活用。 結果的に、同テストがリリースされた段階で、Authleteは他社に先んじて合格済みの状態になっている Authleteが選ばれる理由 OAuth/OIDC仕様への業界最速・最多準拠 • OpenID Providers (OP) & Profiles • Basic OP • Implicit OP • Hybrid OP • Config OP • Dynamic OP • Form Post OP • FAPI1-Advanced OPs & Profiles • FAPI OPs & Profiles • FAPI Adv. OP w/ MTLS • FAPI Adv. OP w/ MTLS, PAR • FAPI Adv. OP w/ Private Key • FAPI Adv. OP w/ Private Key, PAR • FAPI Adv. OP w/ MTLS, JARM • FAPI Adv. OP w/ Private Key, JARM • FAPI Adv. OP w/ MTLS, PAR, JARM • FAPI Adv. OP w/ Private Key, PAR, JARM • FAPI OP - UK Open Banking • UK-OB Adv. OP w/ MTLS • UK-OB Adv. OP w/ Private Key • FAPI OP - Australia CDR • AU-CDR Adv. OP w/ Private Key • AU-CDR Adv. OP w/ Private Key, PAR • FAPI OP - Brazil Open Banking • BR-OB Adv. OP w/ MTLS • BR-OB Adv. OP w/ Private Key • BR-OB Adv. OP w/ MTLS, PAR • BR-OB Adv. OP w/ Private Key, PAR • BR-OB Adv. OP w/ MTLS, JARM • BR-OB Adv. OP w/ Private Key, JARM • BR-OB Adv. OP w/ MTLS, PAR, JARM • BR-OB Adv. OP w/ Private Key, PAR, JARM • BR-OB Adv. OP DCR • FAPI OP - Brazil Open Insurance • BR-OB Adv. OP w/ MTLS • BR-OB Adv. OP w/ Private Key • BR-OB Adv. OP w/ MTLS, PAR • BR-OB Adv. OP w/ Private Key, PAR • BR-OB Adv. OP w/ MTLS, JARM • BR-OB Adv. OP w/ Private Key, JARM • BR-OB Adv. OP w/ MTLS, PAR, JARM • BR-OB Adv. OP w/ Private Key, PAR, JARM • BR-OB Adv. OP DCR • FAPI OP - KSA Open Banking • KSA-OB Adv. OP w/ MTLS, PAR • KSA-OB Adv. OP w/ Private Key, PAR [NEW] • FAPI-CIBA OPs • Certified OPs & Profiles • FAPI-CIBA OP Poll w/ MTLS • FAPI-CIBA OP Poll w/ Private Key • FAPI-CIBA OP Ping w/ MTLS • FAPI-CIBA OP Ping w/ Private Key • FAPI2 Providers & Profiles • FAPI 2.0 OP Security Profile Final & Message Signing Final • FAPI2SP OP MTLS + MTLS • FAPI2SP OP MTLS + DPoP • FAPI2SP OP private key + MTLS • FAPI2SP OP private key + DPoP • FAPI2SP OP OpenID Connect • FAPI2MS OP JAR • FAPI2MS OP JARM • Australia FAPI 2.0 OP ConnectID Final • FAPI2MS with ConnectId support 3 * https://openid.net/certification/ をもとに構成
  4. Copyright © 2025 Authlete, Inc. All Rights Reserved. MCP で利用される関連仕様

    対応状況 OAuth 2.1 IETF DRAFT (draft-ietf-oauth-v2-1-13) OAuth 2.0 + 拡張仕様のプラクティ ス集なので基本的には対応済み Authorization Server Metadata (RFC 8414) OpenID Connect Discovery とともに 対応可能 Dynamic Client Registration Protocol (RFC 7591) 対応済み。Open Banking での実績あ り。 Resource Indicators for OAuth 2.0 (RFC 8707) 対応済み。 OAuth Client ID Metadata Document (draft-ietf-oauth-client-id-metadata-document-00) ベータ版の提供開始 Authlete のサポート状況 New!
  5. Copyright © 2025 Authlete, Inc. All Rights Reserved. Goodbye DCR,

    Hello CIMD • MCP Version 2025-06-18 – 認可サーバーと MCP クライアントは OAuth 2.0 Dynamic Client Registration Protocol (RFC7591) をサポートすべき (SHOULD) である • MCP Version 2025-11-25 – 認可サーバーと MCP クライアントは OAuth Client ID Metadata Documentをサポート すべき (SHOULD) である – Dynamic Client Registration: 後方互換または特別な要件で利用
  6. Copyright © 2025 Authlete, Inc. All Rights Reserved. メタデータによる認可サーバーの特定 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization
  7. Copyright © 2025 Authlete, Inc. All Rights Reserved. Protected Resource

    Metadata 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization HTTP 200 OK { "resource": "https://localhost:3443/mcp", "authorization_servers": [ "https://localhost:3443" ], "scopes_supported": [ "mcp:tickets:read", "mcp:tickets:write" ], "bearer_methods_supported": [ "header" ], "resource_documentation": "https://localhost:3443/docs/mcp", "resource_policy_uri": "https://localhost:3443/policy/mcp", "authorization_details_types_supported": [ "ticket-reservation“ ] }
  8. Copyright © 2025 Authlete, Inc. All Rights Reserved. CIMD によるクライアント登録

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Authorization Metadata Metadata
  9. Copyright © 2025 Authlete, Inc. All Rights Reserved. Authorization Server

    Metadata 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Authorization Metadata Metadata クライアント 登録 HTTP 200 OK { "issuer": "https://localhost:3443", "authorization_endpoint": "https://localhost:3443/oauth/authorize", "prompt_values_supported": [ "none", "login", "consent", "select_account", "create" ], "token_endpoint": "https://localhost:3443/oauth/token", "userinfo_endpoint": "https://localhost:3443/oauth/userinfo", "jwks_uri": "https://localhost:3443/.well-known/jwks.json", "registration_endpoint": "https://localhost:3443/oauth/register", "client_id_metadata_document_supported": true, "scopes_supported": [ "dcr", "mcp:tickets:read", "mcp:tickets:write", "profile:read" ], "response_types_supported": [ "code" ]... }
  10. Copyright © 2025 Authlete, Inc. All Rights Reserved. 認可リクエストに https

    の URI を指定 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Authorization Metadata Metadata GET /oauth/authorization?client_id=https://mcp-client.example.com/client.json&... GET https://mcp-client.example.com/client.json
  11. Copyright © 2025 Authlete, Inc. All Rights Reserved. client_id で指定されたメタデータを取得

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Authorization Metadata Metadata GET /oauth/authorization?client_id=https://mcp-client.example.com/client.json&... GET https://mcp-client.example.com/client.json { "client_name": "MCP Client", "grant_types": ["authorization_code","refresh_token"], "response_types": ["code"], "token_endpoint_auth_method": "none", "application_type": "native", "client_id": " https://mcp-client.example.com/client.json", "client_uri": "https://mcp-client.example.com", "redirect_uris": [ "https://mcp-client.example.com/callback" ] }
  12. Copyright © 2025 Authlete, Inc. All Rights Reserved. メタデータをもとにクライアント登録 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Authorization Metadata Metadata GET /oauth/authorization?client_id=https://mcp-client.example.com/client.json&... クライアント 登録 GET https://mcp-client.example.com/client.json
  13. Copyright © 2025 Authlete, Inc. All Rights Reserved. パブリック クライアントでの

    CIMD 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/client.json Authorization クライアント 登録
  14. Copyright © 2025 Authlete, Inc. All Rights Reserved. MCP クライアントのバックエンドで公開

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/client.json Authorization クライアント 登録 GET /client.json Metadata MCP Client Backend
  15. Copyright © 2025 Authlete, Inc. All Rights Reserved. ネイティブアプリ +

    クライアント認証 MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization Metadata MCP Client Backend
  16. Copyright © 2025 Authlete, Inc. All Rights Reserved. セキュアエレメントでキーペアを生成 MCP

    Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization Metadata MCP Client Backend Generate key-pare Secure Element
  17. Copyright © 2025 Authlete, Inc. All Rights Reserved. 公開鍵をクライアントのバックエンドに送信 MCP

    Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization Metadata MCP Client Backend public key + Attestation Generate key-pare Secure Element
  18. Copyright © 2025 Authlete, Inc. All Rights Reserved. 公開鍵を含むメタデータを生成 MCP

    Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization Metadata MCP Client Backend public key + Attestation Generate key-pare Secure Element
  19. Copyright © 2025 Authlete, Inc. All Rights Reserved. メタデータ URI

    をクライアントに応答 MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー Metadata Registration Authorization Metadata MCP Client Backend public key + Attestation Generate key-pare Secure Element <app-guid>/client.json
  20. Copyright © 2025 Authlete, Inc. All Rights Reserved. 認可リクエスト 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/<app-guid>/client.json Authorization Metadata MCP Client Backend public key + Attestation Generate key-pare Secure Element <app-guid>/client.json
  21. Copyright © 2025 Authlete, Inc. All Rights Reserved. メタデータをもとにクライアント登録 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/<app-guid>/client.json Authorization GET /<app-guid>/client.json Metadata MCP Client Backend public key + Attestation クライアント 登録 Generate key-pare Secure Element <app-guid>/client.json
  22. Copyright © 2025 Authlete, Inc. All Rights Reserved. private_key_jwt などでクライアント認証可

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/<app-guid>/client.json Authorization GET /<app-guid>/client.json Metadata MCP Client Backend public key + Attestation クライアント 登録 Generate key-pare Secure Element <app-guid>/client.json
  23. Copyright © 2025 Authlete, Inc. All Rights Reserved. Authlete は

    CIMD を代行 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration GET /oauth/authorization?client_id=https://mcp-client.example.com/<app-guid>/client.json Authorization GET /<app-guid>/client.json Metadata MCP Client Backend public key + Attestation クライアント 登録 Generate key-pare Secure Element <app-guid>/client.json
  24. Copyright © 2025 Authlete, Inc. All Rights Reserved. Copyright ©

    2025 Authlete, Inc. All Rights Reserved. Demo
  25. Copyright © 2025 Authlete, Inc. All Rights Reserved. 27 Authlete

    3.0 でお試しいただけます 参考: https://console.authlete.com/
  26. Copyright © 2025 Authlete, Inc. All Rights Reserved. VS Code

    に保存された MCP 用の DCR クライアント ID & トークンキャッシュ を削除するには removeDynamicAuthenticationProviders コマンドを使おう お得な情報 チェックをつけて OK で クライアント ID とトークン キャッシュが削除される
  27. Copyright © 2025 Authlete, Inc. All Rights Reserved. • 1.

    認可サーバーがクライアントを信頼する仕組みが存在しない – 6.8 Client ID Domain Trust で信頼するドメインで制限する • 2. クライアントが公開したメタデータを認可サーバーがカスタマイズする 方法が定義されていない – OpenID Connect Relying Party Metadata Choices が利用できるのでは – OpenID Federation の Metadata Policy が利用できるのでは • 3. 認可サーバーが登録した内容をクライアントに伝える手段がない – 今のところ困ることはなさそうだけど、2 でいろいろカスタマイズしたら必要になっ てくるかも 課題
  28. Copyright © 2025 Authlete, Inc. All Rights Reserved. 35 •

    CIMD で MCP の相互運用性が高まることが期待される • 仕様がざっくりしているので、認可サーバーが考慮すべき点が多い • Authlete は Confidential Client 登録を含む CIMD をサポートしている • Authlete の独自機能で認可サーバーの実装負担をカバー • とはいえ発展途上の仕様なので、ぜひ利用いただいてフィードバックください まとめ
  29. Copyright © 2025 Authlete, Inc. All Rights Reserved. Thank You

    www.authlete.com [email protected] Copyright © 2025 Authlete, Inc. All Rights Reserved.
  30. Copyright © 2025 Authlete, Inc. All Rights Reserved. Copyright ©

    2025 Authlete, Inc. All Rights Reserved. We Are Hiring!! https://www.authlete.com/ja/careers/
  31. Copyright © 2025 Authlete, Inc. All Rights Reserved. Copyright ©

    2025 Authlete, Inc. All Rights Reserved. Appendix
  32. Copyright © 2025 Authlete, Inc. All Rights Reserved. Authorization Server

    Metadata 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration Authorization
  33. Copyright © 2025 Authlete, Inc. All Rights Reserved. registration_endpoint を特定

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server Metadata Registration Authorization HTTP 200 OK { "issuer": "https://localhost:3443", "authorization_endpoint": "https://localhost:3443/oauth/authorize", "prompt_values_supported": [ "none", "login", "consent", "select_account", "create" ], "token_endpoint": "https://localhost:3443/oauth/token", "userinfo_endpoint": "https://localhost:3443/oauth/userinfo", "jwks_uri": "https://localhost:3443/.well-known/jwks.json", "registration_endpoint": "https://localhost:3443/oauth/register", "scopes_supported": [ "dcr", "mcp:tickets:read", "mcp:tickets:write", "profile:read" ], "response_types_supported": [ "code" ]... }
  34. Copyright © 2025 Authlete, Inc. All Rights Reserved. registration_endpoint に

    POST リクエスト 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration Authorization
  35. Copyright © 2025 Authlete, Inc. All Rights Reserved. 登録リクエストの例 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration Authorization POST /oauth/register { "redirect_uris": [ "http://localhost:6274/oauth/callback" ], "token_endpoint_auth_method": "none", "grant_types": [ "authorization_code", "refresh_token" ], "response_types": [ "code" ], "client_name": "MCP Inspector", "scope": "mcp:tickets:read mcp:tickets:write“ ... }
  36. Copyright © 2025 Authlete, Inc. All Rights Reserved. メタデータをもとにクライアント登録 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration Authorization クライアント 登録
  37. Copyright © 2025 Authlete, Inc. All Rights Reserved. 登録レスポンスの例 401

    Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration Authorization クライアント 登録 HTTP 200 OK { "default_max_age": 0, "client_id": "3022400119", "client_id_issued_at": 1756178051, "id_token_signed_response_alg": "RS256", "redirect_uris": [ "http://localhost:6274/oauth/callback" ], ... }
  38. Copyright © 2025 Authlete, Inc. All Rights Reserved. 登録した client

    情報を使い認可リクエスト 401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration GET /oauth/authorization?client_id=3022400119&redirect_uri=http://localhost:6274... Authorization
  39. Copyright © 2025 Authlete, Inc. All Rights Reserved. DCR によるクライアント登録

    401 Unauthorized protected resource metadata POST /mcp GET /.well-known/oauth-protected-resource/mcp MCP Client MCP Endpoint Metadata MCP Server 認可サーバー GET /.well-known/oauth-authorization-server POST /oauth/register Metadata Registration GET /oauth/authorization?client_id=3022400119&redirect_uri=http://localhost:6274... Authorization HTTP 200 OK { "default_max_age": 0, "client_id": "3022400119", "client_id_issued_at": 1756178051, "id_token_signed_response_alg": "RS256", "redirect_uris": [ "http://localhost:6274/oauth/callback" ], ... }