More Related Content Similar to The Latest Specs of OpenID Connect at #idcon 9
Similar to The Latest Specs of OpenID Connect at #idcon 9 (20) The Latest Specs of OpenID Connect at #idcon 93. はじめに
• 情報漏えい騒ぎ
– いまさらPWの使いまわしのリスクに注目
• いまこそOpenID/OAuthの出番?
• OpenID / OAuth へのネガティブな影響
– あるOPのパスワードが漏れたらRP/Clientまで
全部やられるね → orz
今こそ安全なAuthN/Zのしくみを提供してア
ピールすべき!
3
4. OpenIDとOAuth
• OpenID Auth 2.0 • OAuth 1.0a
• OpenID OAuth Extension
• OpenID v.Next • OAuth WRAP
– Artifact Binding (for • OAuth 2.0
Mobile etc...)
• OpenID Connect
4
5. OpenID Connect
• Authorization : OAuth 2.0 Base
• Authentication
• Attribute transmission
– UserInfo Endpoint
• Discovery
– JSON Based
• Dynamic Client Registration
• Session Management
– Refresh/Check/Logout 5
6. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
6
7. Latest Specs
• Core
– http://openid.net/specs/openid-connect-core-1_0.html
• Framework
– http://openid.net/specs/openid-connect-framework-
1_0.html
• Discovery
– http://openid.net/specs/openid-connect-discovery-
1_0.html
• HTTP Redirect Binding
– http://openid.net/specs/openid-connect-http-redirect-
7
1_0.html
8. Latest Specs
• Session Management
– http://openid.net/specs/openid-connect-session-
1_0.html
• Dynamic Client Registration
– http://openid.net/specs/openid-connect-registration-
1_0.html
• UserInfo
– http://openid.net/specs/openid-connect-userinfo-
1_0.html
8
9. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
9
10. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
10
11. GET /.well-known/simple-web-discovery
OpenID Connect Discovery
• Endpoint,メタデータをDiscoveryするしくみ
– Endpoints
– サポートしているFlow,Identifierの種類など
• HTTPS + GETでDiscovery用エンドポイントに
アクセス
• レスポンスフォーマットはJSONオブジェクト
– XRDよりも簡単!?
11
12. GET /.well-known/simple-web-discovery
OpenID Connect Simple Web Discovery
• Discoveryに利用できるIdentifierは3種類
– Hostname
– Email
– URL
• OpenID Connectの最初の利用例
– Emailアドレスを入力(≒WebFinger)
– OP Identifierを入力(≒OpenID Auth 2.0)
– OpenID URLを入力(≒OpenID Auth 1.1)
12
13. GET /.well-known/simple-web-discovery
OpenID Connect Simple Web Discovery
• Request
GET
/.well-known/simple-web-discovery?
principal= joe@example.com&
service=http://openid.net/specs/connect/1.0/issuer
HTTP/1.1
Host: example.com
13
14. GET /.well-known/simple-web-discovery
OpenID Connect Simple Web Discovery
• Response
HTTP/1.1 200 O.K.
Content-Type: application/json
{ "locations":
["https://example.com/auth"]
}
別のURLへのリダイレクト指定も可能
14
15. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
15
16. OpenID Connect
Dynamic Client Registration
• DiscoveryによりRegistration Endpointを
取得
• Registration EndpointにClient登録/更新
のリクエストを送る
16
17. OpenID Connect
Dynamic Client Registration
• Request (HTTP POST, JSONオブジェクト)
– type : “client_associate”/“client_update”
– client_id
– client_secret
– contact : email list
– application_type, application_name
– logo_url, redirect_url, js_origin_url, jwk_url
– sector_identifier
@_nat JWTではないのでしょうか?
17
18. OpenID Connect
Dynamic Client Registration
• Response (JSON object)
– client_id
– client_secret
– expires_in
18
19. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
19
23. Authorization Code Flow
End User Client AuthZ Resource
0. Clientにサービス要求 Server Server
1. Request準備
2. AuthZ ServerにRequestを送信
3. Authentication
4. Consent/Authorization
5. AuthZ CodeとともにUserを戻す
6. Assertion要求
7. Assertion応答
8. UserInfo Endpointにアクセス
23
9. 属性情報など応答
24. Authorization Code Flow
End User Client AuthZ Resource
0. Clientにサービス要求 Server Server
1. Request準備
2. AuthZ ServerにRequestを送信
3. Authentication
4. Consent/Authorization
5. AuthZ CodeとともにUserを戻す
6. Assertion要求
7. Assertion応答
8. UserInfo Endpointにアクセス
24
9. 属性情報など応答
25. Requestの送り方は3種類
• Query Parameters Method
– クエリパラメータにそのまま含む
• Request Parameter Method
– OpenID Connect RequestをToken(文字列)
にしてrequestパラメータとして指定
• UserInfo/Session Management関連
• Request File Method
– JSONオブジェクトを返すURLを用意して、その
URLをパラメータに含む
25
28. request パラメータ
• OpenID Connect リクエスト
– 下記機能についてのリクエスト
• UserInfo : 必要なクレーム、フォーマット
• Session Management : ID Tokenに含むクレーム、
PAPE関連のパラメータなど
• JSONオブジェクトを文字列として表現
– “jwt_header.jwt_payload.jwt_crypto”
• jwt_header : メタデータをBase64URLEnc
• jwt_payload : JSONオブジェクトをBase64URLEnc
• jwt_crypto : Signatureなど
28
29. Request File Method
• JSON オブジェクトを返すRequest URLを作
成
https://rp.example.com/rf.js
{
"response_type": "code",
"client_id": "s6BhdRkqt3",
"redirect_uri":
"https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb",
"scope": "openid",
"state": "af0ifjsldkj“
29
}
31. Authorization Code Flow
End User Client AuthZ Resource
0. Clientにサービス要求 Server Server
1. Request準備
2. AuthZ ServerにRequestを送信
2.5. Request File 取得
3. Authentication
4. Consent/Authorization
5. AuthZ CodeとともにUserを戻す
6. Assertion要求
7. Assertion応答
8. UserInfo Endpointにアクセス
31
9. 属性情報など応答
32. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
32
34. OpenID Request Object
• OpenID Connect リクエスト
– 下記機能についてのリクエスト
• UserInfo : 必要なクレーム、フォーマット
• Session Management : ID Tokenに含むクレーム、
PAPE関連のパラメータなど
• JSONオブジェクトを文字列として表現
– “jwt_header.jwt_payload.jwt_crypto”
• jwt_header : メタデータをBase64URLEnc
• jwt_payload : JSONオブジェクトをBase64URLEnc
• jwt_crypto : Signatureなど
34
35. OpenID Request Object
{
"inf":
{
"clm":
{ "name": null, "nickname": {"opt": true},
"email": null, "verified": null,
"picture": {"opt": true}, },
"fmt": "sig"
}
"idt":
{
"mxa": 86400,
"eaa": "2" 35
}
36. UserInfo Endpoint : Claims
• 下記の3種類のClaimを提供する
– Normal Claims : OPがAssertしたClaims
– Aggregated Claims : OPから返されるが、別
のOPがAssertしたClaims
• JWT形式
– Distributed Claims
• 別のOPのエンドポイントから返されるClaims
• endpoint, access_token
36
37. Authorization Code Flow
End User Client AuthZ Resource
0. Clientにサービス要求 Server Server
1. Request準備
2. AuthZ ServerにRequestを送信
3. Authentication
4. Consent/Authorization
5. AuthZ CodeとともにUserを戻す
6. Assertion要求
7. Assertion応答
8. UserInfo Endpointにアクセス
37
9. 属性情報など応答
38. {
"name": "Jane Doe"
...
"_claim_names": { "birthday": "src1",
"eye_color": "src1",
"credit_score": "src3" },
"_claim_sources": {
"src1": {"JWT":
"JWT_hdr.JWT_claims.JWT_crypto"},
"src3": {"endpoint":
"https://creditagency.example.com/claimshere",
"access_token": "ksj3n283dke"} }
}
38
39. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
39
40. OpenID Connect UserInfo
• FrameworkにあったNormal Claimsについ
ての定義
– Profileデータ
• Request
– access_token
– schema : “openid”
40
42. Latest Specs
• Core : Messages, Abstract flow
• Framework : Req/Res formats
• Discovery
• HTTP Redirect Binding : HTTP protocol
binding
• Session Management
• Dynamic Client Registration
• UserInfo
42
43. OpenID Connect
Session Management
• ID Tokenを用いたセッション管理
– 現在誰がログイン中なのか確認する
– Client側からログアウトさせる
• ID Token : JWSを用いた署名付きクレーム
– issur
– client_id
– user_id
– audience
– exp
43
44. OpenID Connect
Session Management
• Creating Session : ID Token発行
– Authorization Request
• Clientはresponse_type に “id_token”を含む
– Access Token Response
• AuthZ ServerはAccess Tokenと一緒にid_tokenを
渡す
44
45. OpenID Connect
Session Management
• Session Management Endpoints
– Refresh Session : expireしたid_tokenの更新
– Check Session : id_tokenの内容取得
– End Session : Clientからのログアウト要求
45