- 追加された行はこの色です。
- 削除された行はこの色です。
「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。
-[[戻る>OpenID Connect]]
* 目次 [#m79145b4]
#contents
*ユーザー属性クレーム群 [#kb7212b1]
Finalを参照して記述。
**Standard Claims [#c71c8ad5]
*Standardクレーム [#c71c8ad5]
[[JWTのクレーム>JWT#m5b94cda]]を除く(subだけ重複)。
**グループ名 [#xab233f9]
-クレームのグループ名称。
-[[scopeパラメタで使用して当該グループのクレームを要求する。>#k95e5b83]]
**クレーム名 [#ed518bcc]
-クレームの個別名称。
-[[claimsパラメタで使用して当該クレームを要求する。>#lfaacf35]]
**一覧 [#b4844d78]
|項番|>|グループ名|意味|h
|~||クレーム名|~|h
|1|>|sub|ユーザーの一意識別子|
|2|>|profile|プロフィール|
|2-1|・|name|フルネーム|
|2-2|・|given_name|名|
|2-3|・|family_name|姓|
|2-4|・|middle_name|ミドルネーム|
|2-5|・|nickname|ニックネーム|
|2-6|・|preferred_username|好みのユーザー名|
|2-7|・|profile|プロフィールページの URL|
|2-8|・|picture|プロフィール画像の URL|
|2-9|・|website|Web サイトやブログの URL|
|2-10|・|gender|性別。female と male が定義済み。|
|2-11|・|birthdate|誕生日。YYYY-MM-DD。|
|2-12|・|zoneinfo|タイムゾーン。Europe/Paris など。|
|2-13|・|locale|ロケール。en-US など。|
|2-14|・|updated_at|情報最終更新日。Unix エポックからの経過秒数。|
|3|>|email|電子メール|
|3-1|・|email|電子メールアドレス|
|3-2|・|email_verified|電子メールアドレスが検証済みか否かの真偽値|
|4|>|phone|電話|
|4-1|・|phone_number|電話番号|
|4-2|・|phone_number_verified|電話番号が検証済みか否かの真偽値|
|5|>|address|住所 JSON object。書式は「5.1.1. Addressクレーム」に記載。|
|5-1|・|formatted|フォーマットされたフルメールアドレス、表示用・郵送用に使用|
|5-2|・|street_address|通り・番地、号室、私書箱、複数行の拡張された住所情報。|
|5-3|・|locality|City or locality|
|5-4|・|region|State, province, prefecture, or region.|
|5-5|・|postal_code|Zip code or postal code|
|5-6|・|country|Country name|
**多言語化 [#u1556f80]
-クレームによっては多言語化可能
-クレーム名に続いて"#ja-Kana-JP"などの言語タグを付与する。
-言語タグとしては、[[BCP47 [RFC5646]>https://tools.ietf.org/html/rfc5646]] 言語タグを使用。
*格納要求 [#qb26baa1]
*ユーザー属性クレーム群の格納要求 [#qb26baa1]
**scopeパラメタによる格納要求 [#k95e5b83]
scopeパラメタによってユーザー属性クレーム群の格納要求を行うことができる。
***グループ名 [#xc20fc3f]
[[前述のグループ名>#c71c8ad5]](profile, email, phone, address)をscope値に指定可能。
***格納部位 [#z4362392]
-UserInfoエンドポイントからUserInfoレスポンス(JSON オブジェクト)として返される.
-response_type 値が id_token の場合、
--この場合、Access Token が発行されない。
--ユーザー属性クレーム群はID Token で返却される。
**claimsパラメタによる詳細な格納要求 [#lfaacf35]
claimsパラメタによって、[[scopeパラメタ>#k95e5b83]]より詳細なユーザー属性クレーム群の格納要求を行うことができる。
-userinfoと、id_tokenに対するクレームを要求できる。
--通常、[[scopeパラメタ>#k95e5b83]]を使用して、クレームを要求するが、~
http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
--claimsパラメタを使用して、クレームを要求することもできる。~
http://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter
-claimsパラメタを使用して特定のクレームの返却を要求する。~
claimsパラメタは、クレームをリスト化したJSON オブジェクトである。
--[[ユーザー属性クレーム群>#kb7212b1]]に含まれていないクレームを要求する唯一の方法。
--[[scopeパラメタ>#k95e5b83]]では指定することが出来ない[[ユーザー属性クレーム群>#kb7212b1]]の特定の組み合わせを要求する唯一の方法。
***トップレベルメンバ [#va260684]
個別のクレームの名前をメンバー名とする JSON オブジェクト
-userinfoメンバ (OPTIONAL)~
UserInfoエンドポイントへ返却を要求する個々のクレームのリスト。
--当メンバが存在した場合、
---[[scopeパラメタ>#k95e5b83]]で要求されたクレームに加え、
---当メンバでリストされたクレームも返却される。
--当メンバが存在しなかった場合、
---[[scopeパラメタ>#k95e5b83]]で要求されたクレームのみが返却される。
---userinfoメンバを指定する際は、UserInfo Endpoint を使用するために、~
response_type に対し, Access Token を Client に発行するタイプの値を指定しなければならない。
-id_tokenメンバ (OPTIONAL)~
[[ID トークン>OpenID Connect#ofb73c59]]内に格納して返却を要求する個々のクレームのリストを示す。
--当メンバが存在した場合、
---デフォルトのクレームに加え
---当メンバでリストされたクレームも返却される。
--当メンバが存在しなかった場合、
---デフォルトのクレームのみが返却される。
***個別のクレーム値 [#q9d112d2]
-null値~
デフォルトの形式
-JSON値
--essential~
Essential(必須) or Voluntary(任意)
{"essential": true}
--value~
指定の値を返す(用途不明確
指定の値を返す(固定値だが、用途不明確
{"value": "248289761001"}
--values~
優先順に指定の値を返す(用途不明確
優先順に指定の値を返す(許容できる値の範囲
"acr": {"essential": true,
"values": ["urn:mace:incommon:iap:silver",
"urn:mace:incommon:iap:bronze"]}
***クレーム要求JSONの例 [#pd68c57b]
クレーム要求JSONの例を以下に示す:
{
"userinfo":
{
"given_name": {"essential": true},
"nickname": null,
"email": {"essential": true},
"email_verified": {"essential": true},
"picture": null,
"http://example.info/claims/groups": null
},
"id_token":
{
"auth_time": {"essential": true},
"acr": {"values": ["urn:mace:incommon:iap:silver"] }
}
}
*ユーザー情報エンドポイント [#k1d9c845]
*エンドポイント [#k1d9c845]
-OAuth 2.0のResource ServerのWebAPI
-HTTP的には、HTTPS必須
**Request [#y620d43e]
-HTTP の GET と POST メソッドをサポートする。
-UserInfoリクエストの一例を示す:
GET /userinfo HTTP/1.1
Host: server.exampletechinfoofmicrosofttech.osscons.jp
Authorization: Bearer ・・・・・
**Response [#k20c216c]
-UserInfoレスポンスは JSON オブジェクトとして返される。
--UserInfoクレームは JSON オブジェクトのメンバとして返される。
--UserInfoレスポンスのクレームセットには、必ず sub (subject) クレームを含める。
--[[ユーザー属性クレーム群>#kb7212b1]]に加え、そこに明記されていないクレームも返却可能。
--Idp(OP)は要求された クレームの値を、必ずしも返さなくてもよい。
--クレームが返されない場合、null や空文字列ではなく、JSON オブジェクトのメンバから除かれるべき。
-JWTによる署名 or 暗号化、若しくは、署名 and 暗号化を行う場合
--クレームは JWT で返されるため、Content-Type は application/jwtとする。
--署名する場合、subに加え、iss (issuer) クレームと aud (audience) クレームを含むべき。
--暗号化のアルゴリズムは登録時のuserinfo_encrypted_response_algで指定する。
--暗号化のアルゴリズムは[[Registration>OpenID Connect#e0b59f80]]による[[userinfo_encrypted_response_alg>OpenID Connect - Dynamic Client Registration#xc12bcf1]]で指定する。
--署名と暗号化の両方が要求された場合、レスポンスは [[JWT]] で定義されているように、~
結果はネストされた [[JWT]] となり、 署名した後に暗号化しなければならない。
-クライアントによるUserInfoレスポンスの検証
--TLS サーバー証明書チェックを通じてIdp(OP)を検証する。
--UserInfoレスポンスが[[JWT]]の場合、署名検証や復号化を行う。
--[[ID トークン>OpenID Connect#ofb73c59]]とUserInfoクレームのsubが一致することを検証する必要がある。
**Request & Responseの例 [#q12483e0]
以下に UserInfoレスポンスの一例を示す。
-成功
HTTP/1.1 200 OK
Content-Type: application/json
{
"sub": "ユーザID 的 な情報",
"name": "Jane Doe",
"given_name": "Jane",
"family_name": "Doe",
"preferred_username": "j.doe",
"email": "janedoe@techinfoofmicrosofttech.osscons.jp",
"picture": "http://techinfoofmicrosofttech.osscons.jp/janedoe/me.jpg"
}
-失敗
HTTP/1.1 401 Unauthorized
WWW-Authenticate: error="invalid_token",
error_description="The Access Token expired"
**[[Discovery、Dynamic Client Registration>OpenID Connect#h5793a09]]との関連 [#u39da1e3]
設定によって、[[ID トークン>OpenID Connect#ofb73c59]]相当の情報が、
-[[JWT]] 形式もしくは [[JSON]] 形式で返される。
-[[JWT]]の署名アルゴリズムも影響を受ける。
*クレーム・タイプ [#i452a5f2]
-以下の3つのクレーム値の表現形式が定義されている。
--[[Normalクレーム>#va4e188a]] (REQUIRED)
--[[Aggregatedクレーム>#d7258e5c]] (OPTIONAL)
--[[Distributedクレーム>#r9f8936f]] (OPTIONAL)
-なお、[[Aggregatedクレーム>#d7258e5c]]と、[[Distributedクレーム>#r9f8936f]]は、~
--sub 値が Claims Provider に置ける End-User の識別子でない限り, sub (subject) クレームを含むべきでない.~
--また OpenID Provider あるいは他の Party が利用するために sub 値を提供すべきでもない.
**Normalクレーム [#va4e188a]
-OpenID Provider によって直接アサートされたクレーム。
-JSON オブジェクトの中にメンバとして表記される。
{
"name": "Jane Doe",
"given_name": "Jane",
"family_name": "Doe",
"email": "janedoe@example.com",
"picture": "http://example.com/janedoe/me.jpg"
}
**Aggregatedクレーム [#d7258e5c]
***概要 [#p704b299]
-OpenID Provider 以外の Claims Provider によってアサートされたクレームであるが, OpenID Provider から返却されるクレーム.
-JSON オブジェクト中で, _claim_names および _claim_sources という特殊なメンバを用いて表記される.
--_claim_names~
_claim_sources メンバーの中にあるメンバー名への参照
--_claim_sources~
[[JWT]]を値として持つJSON オブジェクト(subクレームを含まない)
***例 [#ic4027e5]
-Aggregatedクレーム本体~
以下を「jwt_header.jwt_part2.jwt_part3」と[[JWT]]化する。
{
"address": {
"street_address": "1234 Hollywood Blvd.",
"locality": "Los Angeles",
"region": "CA",
"postal_code": "90210",
"country": "US"},
"phone_number": "+1 (310) 123-4567"
}
-Aggregatedクレームを含むクレームセット
{
"name": "Jane Doe",
"given_name": "Jane",
"family_name": "Doe",
"birthdate": "0000-03-22",
"eye_color": "blue",
"email": "janedoe@example.com",
"_claim_names": {
"address": "src1",
"phone_number": "src1"
},
"_claim_sources": {
"src1": {"JWT": "jwt_header.jwt_part2.jwt_part3"}
}
}
**Distributedクレーム [#r9f8936f]
***概要 [#l4b1f4a6]
-OpenID Provider 以外の Claims Provider によってアサートされたクレームであり, OpenID Provider からはその参照だけが返却されるクレーム.
-JSON オブジェクト中で, _claim_names および _claim_sources という特殊なメンバを用いて表記される.
--_claim_names~
_claim_sources メンバーの中にあるメンバー名への参照
--_claim_sources~
endpoint、access_tokenのメンバと値を含む JSON オブジェクト
---endpoint (REQUIRED):~
[[JWT]]形式のDistributedクレームセットを提供するエンドポイントのUrl
---access_token (OPTIONAL):~
endpoint(Resource Server)を利用するためのaccess_token
***例 [#j01f395f]
-Distributedクレーム本体~
以下を「jwt_header.jwt_part2.jwt_part3」と[[JWT]]化して、エンドポイントからレスポンスする。
--その1
{
"shipping_address": {
"street_address": "1234 Hollywood Blvd.",
"locality": "Los Angeles",
"region": "CA",
"postal_code": "90210",
"country": "US"},
"payment_info": "Some_Card 1234 5678 9012 3456",
"phone_number": "+1 (310) 123-4567"
}
--その2
{
"credit_score": 650
}
-Distributedクレームを含むクレームセット
{
"name": "Jane Doe",
"given_name": "Jane",
"family_name": "Doe",
"email": "janedoe@example.com",
"birthdate": "0000-03-22",
"eye_color": "blue",
"_claim_names": {
"payment_info": "src1",
"shipping_address": "src1",
"credit_score": "src2"
},
"_claim_sources": {
"src1": {"endpoint":
"https://bank.example.com/claim_source"},
"src2": {"endpoint":
"https://creditagency.example.com/claims_here",
"access_token": "ksj3n283dke"}
}
}
*その他 [#q7c5ade8]
**多言語化 [#u1556f80]
-クレームによっては多言語化可能
-クレーム名に続いて"#ja-Kana-JP"などの言語タグを付与する。
-言語タグとしては、[[BCP47 [RFC5646]>https://tools.ietf.org/html/rfc5646]] 言語タグを使用。
*参考 [#d876255d]
-Final: OpenID Connect Core 1.0 incorporating errata set 1
--5.1. Standard Claims~
http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
--5. Claims~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#Claims
--5.4. Requesting Claims using Scope Values~
http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
---5.1. Standard Claims~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#StandardClaims
--5.5. Requesting Claims using the "claims" Request Parameter~
https://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter
---5.2. Claims Languages and Scripts~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#ClaimsLanguagesAndScripts
--5.3. UserInfo Endpoint~
http://openid.net/specs/openid-connect-core-1_0.html#UserInfo
---5.3. UserInfo Endpoint~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#UserInfo
---5.4. Requesting Claims using Scope Values~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#ScopeClaims
---5.5. Requesting Claims using the "claims" Request Parameter~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#ClaimsParameter
---5.6. Claim Types~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#ClaimTypes
---5.7. Claim Stability and Uniqueness~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#ClaimStability
--8. Subject Identifier Types~
https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#SubjectIDTypes
----
Tags: [[:IT国際標準]], [[:認証基盤]], [[:クレームベース認証]], [[:OAuth]]