-
Notifications
You must be signed in to change notification settings - Fork 0
MS_OIDCDiscovery
- 戻る(OpenID Connect)
- OpenID Connect - Discovery
- OpenID Connect - Dynamic Client Registration
- OpenID Connect - クライアント認証
- OpenID Connect - 暗号関連
Final を参照して記述。
- Client(RP)がメールアドレスや URL からユーザが利用している IdP/STS(OP)を特定する方法
- WebFinger [RFC7033]を用いる。
- IdP/STS(OP)の特定
- OAuth 2.0 / OIDC エンドポイントの特定
補足(Discovery は 2 段構え): 本ページの内容は
(1) OP ディスカバリ(利用者の識別子から OP を突き止める、WebFinger)と
(2) OP 構成情報(その OP のエンドポイントや対応アルゴリズムを取得する、
/.well-known/openid-configuration)の 2 段に分かれている。
実務で使われるのはほぼ (2) だけで、(1) の WebFinger は
**「利用者にメール アドレスを入力させて自動的に IdP を選ぶ」**という
用途に限られるため、実装している OP は多くない。
TLS サポートと、TLS 証明書のチェックが必要。
-
Resource
- エンドユーザの識別子。
- 必要に応じて正規化が行われる。
- 以下のエンドユーザの識別子がある。
- メアド
- URL
- ホスト名とポート
-
Host
Simple Web Discovery サービスがホストされているサーバ -
Rel
サービスのタイプを識別する URI- 型: OpenID Connect Issuer
- 値:
http://openid.net/specs/connect/1.0/issuer
-
共通項
-
rel
http://openid.net/specs/connect/1.0/issuer -
host
example.com- 若しくは、Resource 中の host 部分
-
-
リクエスト
-
メアド
- value :
joe@example.com - resource:
acct:joe@example.com
GET /.well-known/webfinger ?resource=acct%3Ajoe%40example.com &rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer HTTP/1.1 Host: example.com - value :
-
URL
- value :
https://example.com/joe - resource:
https://example.com/joe
GET /.well-known/webfinger ?resource=https%3A%2F%2Fexample.com%2Fjoe &rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer HTTP/1.1 Host: example.com - value :
-
ホスト名とポート
- value :
example.com:8080 - resource:
https://example.com:8080/
GET /.well-known/webfinger ?resource=https%3A%2F%2Fexample.com%3A8080%2F &rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer HTTP/1.1 Host: example.com:8080 - value :
-
acct URI スキーム
- value :
acct:juliet%40capulet.example@shopping.example.com - resource:
acct:juliet%40capulet.example@shopping.example.com
GET /.well-known/webfinger ?resource=acct%3Ajuliet%2540capulet.example%40shopping.example.com &rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer HTTP/1.1 Host: shopping.example.com - value :
-
-
レスポンス
HTTP/1.1 200 OK Content-Type: application/jrd+json { "subject": "xxxxxx", "links": [ { "rel": "http://openid.net/specs/connect/1.0/issuer", "href": "https://server.example.com" } ] }
※
subjectには、要求した Resource の値が入る。
issuer に /.well-known/openid-configuration を連結した URL を使用。
GET /.well-known/openid-configuration HTTP/1.1
Host: example.com
HTTP/1.1 200 OK
Content-Type: application/json
{
"issuer":
"https://server.example.com",
"authorization_endpoint":
"https://server.example.com/connect/authorize",
"token_endpoint":
"https://server.example.com/connect/token",
"token_endpoint_auth_methods_supported":
["client_secret_basic", "private_key_jwt"],
"token_endpoint_auth_signing_alg_values_supported":
["RS256", "ES256"],
"userinfo_endpoint":
"https://server.example.com/connect/userinfo",
"check_session_iframe":
"https://server.example.com/connect/check_session",
"end_session_endpoint":
"https://server.example.com/connect/end_session",
"jwks_uri":
"https://server.example.com/jwks.json",
"registration_endpoint":
"https://server.example.com/connect/register",
"scopes_supported":
["openid", "profile", "email", "address",
"phone", "offline_access"],
"response_types_supported":
["code", "code id_token", "id_token", "token id_token"],
"acr_values_supported":
["urn:mace:incommon:iap:silver",
"urn:mace:incommon:iap:bronze"],
"subject_types_supported":
["public", "pairwise"],
"userinfo_signing_alg_values_supported":
["RS256", "ES256", "HS256"],
"userinfo_encryption_alg_values_supported":
["RSA1_5", "A128KW"],
"userinfo_encryption_enc_values_supported":
["A128CBC-HS256", "A128GCM"],
"id_token_signing_alg_values_supported":
["RS256", "ES256", "HS256"],
"id_token_encryption_alg_values_supported":
["RSA1_5", "A128KW"],
"id_token_encryption_enc_values_supported":
["A128CBC-HS256", "A128GCM"],
"request_object_signing_alg_values_supported":
["none", "RS256", "ES256"],
"display_values_supported":
["page", "popup"],
"claim_types_supported":
["normal", "distributed"],
"claims_supported":
["sub", "iss", "auth_time", "acr",
"name", "given_name", "family_name", "nickname",
"profile", "picture", "website",
"email", "email_verified", "locale", "zoneinfo",
"http://example.info/claims/groups"],
"claims_parameter_supported":
true,
"service_documentation":
"http://server.example.com/connect/service_documentation.html",
"ui_locales_supported":
["en-US", "en-GB", "en-CA", "fr-FR", "fr-CA"]
}- 追加のパラメタを定義可能
- Session Managementなど、他の仕様で定義されているものもある。
-
issuer(REQUIRED)- WebFinger から返される issuer の値(href)と同じ
- Query や Fragment の Component を含まない https スキームの URL
-
op_policy_uri(OPTIONAL)
Client を登録する人に向けて OP の要求事項を提供する URL。 -
op_tos_uri(OPTIONAL)
Client を登録する人に向けて OP の利用規約を提供する URL。
移行メモ(衍字): 「Client をに登録する人に向けて」(2 箇所)の
衍字を修正した。
補足(
issuerの一致確認は必須): 構成情報のissuerは、
取得先の URL および ID トークンのissクレームと
完全に一致していなければならない。
ここを検証しないと、攻撃者の用意した構成情報を掴まされる
(IdP Mix-Up 攻撃)恐れがある。
-
authorization_endpoint(REQUIRED)
認可エンドポイントの URL -
token_endpoint(REQUIRED)- Token エンドポイントの URL
- Implicit のみの場合は割愛可。
-
token_endpoint_auth_methods_supported(OPTIONAL)- Token エンドポイントでサポートされている認証タイプのリストを含む JSON 配列
- client_secret_basic・client_secret_post・client_secret_jwt・private_key_jwt
-
userinfo_endpoint(RECOMMENDED)
ユーザ情報エンドポイントの URL
(OpenID Connect - Dynamic Client Registrationを参照)
-
registration_endpoint(RECOMMENDED)
動的クライアント登録エンドポイントの URL -
service_documentation(OPTIONAL)- 開発者向け情報ページの URL。
- Dynamic Client Registration をサポートしていない場合
(OpenID Connect - Requestオブジェクトを参照)
-
request_object_endpoint(F-API2)- Request オブジェクト登録用エンドポイント
- 「
/ros」などの値を使用する。 - この場合、
request_uriは- 暗号ランダム値を含む urn になる。
- 値は、Request オブジェクト登録リクエストのレスポンスで変える。
(OpenID Connect の Session Management)
-
refresh_session_endpoint
リフレッシュ・セッション・エンドポイントの URL -
end_session_endpoint
エンド・セッション・エンドポイントの URL
-
jwk_url(REQUIRED)- 署名用の JWK Set 公開鍵の URL。
- 暗号化用の JWK Set 共通の URL。
移行メモ(パラメタ名): 実際の仕様およびサンプル JSON では
jwks_uriである(jwk_urlは Discovery の draft 段階の名前)。
本ページの他の箇所やサンプルではjwks_uriが使われている。
JWS と JWE のアルゴリズム(JWA)のリストを含む JSON 配列
-
Token エンドポイント関連
client_secret_jwt、および private_key_jwt 認証-
token_endpoint_auth_signing_alg_values_supported(OPTIONAL)- JWS 署名アルゴリズム(alg 値)
- RS256 をサポートしなければならない(none はダメ)。
-
-
ID トークン関連
補足(
algとencの役割分担): JWE の
algはコンテンツ暗号鍵(CEK)をどう受け渡すか(RSA1_5、A128KW など)、
encは本文を何で暗号化するか(A128CBC-HS256、A128GCM など)を表す。
上記のパラメタがalgとencで対になっているのはこのためである。
-
response_types_supported(REQUIRED)
サポートする response_type 値のリストを含む JSON 配列 -
scopes_supported(RECOMMENDED)
サポートする scope 値のリストを含む JSON 配列 -
response_modes_supported(OPTIONAL)- サポートする response_mode 値の JSON 配列
- 既定値は
["query", "fragment"]
-
grant_types_supported(OPTIONAL)- サポートする grant_type 値の JSON 配列
- 既定値は
["authorization_code", "implicit"]
-
subject_types_supported(REQUIRED)
サポートする sub クレームの種類の JSON 配列-
public(既定値) pairwise
-
-
claims
-
claims_parameter_supported(OPTIONAL)-
claimsパラメタのサポート - 既定値は
false
-
-
claims_supported(RECOMMENDED)
クレーム名のリストを含む JSON 配列
-
-
acr_values_supported(OPTIONAL)
サポートする認証コンテキストクラス参照のリストを含む
(OpenID Connect - Authentication Context Class Referenceを参照) -
その他
-
display_values_supported(OPTIONAL) -
claim_types_supported(OPTIONAL) - ロケール
-
claims_locales_supported(OPTIONAL) -
ui_locales_supported(OPTIONAL)
-
-
(OpenID Connect - Requestオブジェクトを参照)
-
requestパラメタ-
request_parameter_supported(OPTIONAL)-
requestパラメタのサポート - 既定値は
false
-
-
-
request_uriパラメタ-
request_uri_parameter_supported(OPTIONAL)-
request_uriパラメタのサポート - 既定値は
false
-
-
require_request_uri_registration(OPTIONAL)-
request_uri事前登録の要否 - 既定値は
false
-
-
-
Final: OpenID Connect Discovery 1.0 incorporating errata set 1
http://openid.net/specs/openid-connect-discovery-1_0.html -
sat's memo: OpenID Connect Discovery 1.0 - draft 09 日本語私訳
http://blog.toke.jp/2012/07/draft-openid-connect-discovery-1.html -
keycloakのServer Metadataの変遷 - Qiita
https://qiita.com/tnorimat/items/74100ba1fdd66b313585 -
Add url of the "https://.../.well-known/openid-configuration."
· Issue #83 · OpenTouryoProject/MultiPurposeAuthSite
https://github.com/OpenTouryoProject/MultiPurposeAuthSite/issues/83
https://tools.ietf.org/html/rfc8414
補足(RFC 8414 との関係):
/.well-known/openid-configurationは
OpenID Connect の仕様だが、後に OAuth 2.0 単体でも同じことをしたいという
要求から RFC 8414(/.well-known/oauth-authorization-server)が定義された。
内容はほぼ同じで、多くの実装は両方のパスで同じ JSON を返す。
- OpenID Connect
- OpenID Connect - Dynamic Client Registration
- OpenID Connect - クライアント認証
- OpenID Connect - Requestオブジェクト
- JWK
Tags: IT国際標準, 認証基盤, クレームベース認証, OAuth
このWikiは「Open棟梁Project」,「OSSコンソーシアム 開発基盤部会」によって運営されています。