OIDC ディスカバリドキュメントは、OIDCプロバイダーが公開するJSON形式のメタデータです。 以下のURLで取得できます。
このドキュメントを取得するだけで、クライアントはプロバイダーの 全エンドポイントURL、サポートされる機能、暗号化アルゴリズムなどを 自動的に知ることができます。
- 1.設定ミスの防止
エンドポイントURLを手動で設定すると、タイプミスや古いURLの使用が起こりやすい。 ディスカバリなら常に最新の正しい設定を取得できる。
- 2.プロバイダー切り替えの容易さ
issuerのURLを変更するだけで、別のプロバイダーに切り替えられる。 個別のエンドポイントURLを調べ直す必要がない。
- 3.機能サポートの自動検出
PKCEのサポート有無、使用可能な署名アルゴリズム、 サポートされるスコープなどを自動的に判断できる。
- 4.セキュリティの向上
公開鍵 (JWKS) のURLも含まれるため、 トークン検証に必要な鍵を安全に取得できる。
issuerプロバイダーの識別子URL
必須authorization_endpoint認可エンドポイントのURL
必須token_endpointトークンエンドポイントのURL
必須userinfo_endpointUserInfoエンドポイントのURL
推奨jwks_uriJSON Web Key Set (公開鍵) のURL
必須registration_endpoint動的クライアント登録エンドポイントのURL
推奨scopes_supportedサポートされるスコープの一覧
推奨response_types_supportedサポートされるresponse_type値 (例: "code", "id_token")
必須grant_types_supportedサポートされるgrant_type値 (例: "authorization_code", "refresh_token")
推奨subject_types_supportedサポートされるsubject識別子タイプ (例: "public", "pairwise")
必須id_token_signing_alg_values_supportedIDトークンの署名に使用されるアルゴリズム (例: RS256)
必須token_endpoint_auth_methods_supportedトークンエンドポイントの認証方法 (例: client_secret_basic)
推奨claims_supportedサポートされるクレームの一覧
推奨code_challenge_methods_supportedサポートされるPKCEメソッド (例: S256)
推奨{
"issuer": "https://accounts.example.com",
"authorization_endpoint": "https://accounts.example.com/authorize",
"token_endpoint": "https://accounts.example.com/token",
"userinfo_endpoint": "https://accounts.example.com/userinfo",
"jwks_uri": "https://accounts.example.com/.well-known/jwks.json",
"registration_endpoint": "https://accounts.example.com/register",
"scopes_supported": [
"openid", "profile", "email", "address", "phone"
],
"response_types_supported": [
"code", "code id_token", "id_token"
],
"grant_types_supported": [
"authorization_code", "refresh_token"
],
"subject_types_supported": ["public"],
"id_token_signing_alg_values_supported": ["RS256"],
"token_endpoint_auth_methods_supported": [
"client_secret_basic", "client_secret_post"
],
"claims_supported": [
"sub", "iss", "aud", "exp", "iat",
"name", "email", "email_verified", "picture"
],
"code_challenge_methods_supported": ["S256"]
}https://accounts.google.com/.well-known/openid-configuration
# Microsoft
https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
# Auth0 (テナント名を置換)
https://{tenant}.auth0.com/.well-known/openid-configuration
次のステップ
次は UserInfoエンドポイント で、ユーザー情報を取得する仕組みを学びましょう。