「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
※ このページは、ドラフト 15 を参考にして作成。
以下の弱点のために、
以下の攻撃が可能。
対策として、認可リクエストのパラメタ群をJWTで送信する
(認証要求に署名し、オプションで暗号化できる。)
本OAuth 2.0 拡張がOpenID Connectによって追加された。
このアプリケーション層セキュリティの使用により、
JWT化された認可リクエストのパラメタ群をRequestオブジェクトと呼ぶ。
Requestオブジェクト(JWT)のペイロードをbase64urlデコードした文字列。
認可Requestの全てのパラメタがRequestオブジェクトに同梱されている。
{ "alg": "RS256", "kid": "k2bdc" }
{ "iss": "s6BhdRkqt3", "aud": "https://server.example.com", "response_type": "code id_token", "client_id": "s6BhdRkqt3", "redirect_uri": "https://client.example.org/cb", "scope": "openid", "state": "af0ifjsldkj", "nonce": "n-0S6_WzA2Mj", "max_age": 86400 }
{ "iss": "s6BhdRkqt3", "aud": "https://server.example.com", "response_type": "code id_token", "client_id": "s6BhdRkqt3", "redirect_uri": "https://client.example.org/cb", "scope": "openid", "state": "af0ifjsldkj", "nonce": "n-0S6_WzA2Mj", "max_age": 86400, "claims": { "userinfo": { "given_name": { "essential": true }, "nickname": null, "email": { "essential": true }, "email_verified": { "essential": true }, "picture": null }, "id_token": { "gender": null, "birthdate": { "essential": true }, "acr": { "values": [ "urn:mace:incommon:iap:silver" ] } } } }
署名を検証する場合、JWK形式で表されるRSA公開鍵を使用する。
{ "kty":"RSA", "kid":"k2bdc", "n":"y9Lqv4fCp6Ei-u2-ZCKq83YvbFEk6JMs_pSj76eMkddWRuWX2aBKGHAtKlE5P 7_vn__PCKZWePt3vGkB6ePgzAFu08NmKemwE5bQI0e6kIChtt_6KzT5OaaXDF I6qCLJmk51Cc4VYFaxgqevMncYrzaW_50mZ1yGSFIQzLYP8bijAHGVjdEFgZa ZEN9lsn_GdWLaJpHrB3ROlS50E45wxrlg9xMncVb8qDPuXZarvghLL0HzOuYR adBJVoWZowDNTpKpk2RklZ7QaBO7XDv3uR7s_sf2g-bAjSYxYUGsqkNA9b3xV W53am_UZZ3tZbFTIh557JICWKHlWj5uzeJXaw", "e":"AQAB" }
Requestオブジェクトの渡し方には "request" と "request_uri" の2つのパラメタを使用する方法がある。
Requestオブジェクトの値を直接渡す。
GET /authz?request=eyJhbG..AlMGzw HTTP/1.1 Host: server.example.com
https://server.example.com/authorize? response_type=code%20id_token &client_id=s6BhdRkqt3 &request_uri=https%3A%2F%2Ftfp.example.org%2Frequest.jwt %23GkurKxf5T0Y-mnPFCHqWOMiZi4VS138cQO_V7PZHAdM &state=af0ifjsldkj
※ この場合、response_type, client_id, state値の同梱は不要?
GET /request.jwt HTTP/1.1 Host: tfp.example.org
HTTP/1.1 200 OK Date: Thu, 16 Feb 2017 23:52:39 GMT Server: Apache/2.2.22 (tfp.example.org) Content-type: application/jwt Content-Length: 1250 Last-Modified: Wed, 15 Feb 2017 23:52:32 GMT ey・・・(JWT)・・・
https://tfp.example.org/request.jwt#GkurKxf5T0Y-mnPFCHqWOMiZi4VS138cQO_V7PZHAdM
下記手順で取得したRequestオブジェクトを複合する。
復号化に失敗した場合、Authorization Serverは「invalid_request_object」エラーを返す。
(d) (collection minimization) The request can be signed by a third party attesting that the authorization request is compliant with a certain policy. For example, a request can be pre-examined by a third party that all the personal data requested is strictly necessary to perform the process that the end-user asked for, and statically signed by that third party. The authorization server then examines the signature and shows the conformance status to the end-user, who would have some assurance as to the legitimacy of the request when authorizing it. In some cases, it may even be desirable to skip the authorization dialogue under such circumstances.
For example, the authorization server may provide a URL to which the client POSTs the request object and obtains the Requiest URI. This URI is the Request Object URI, "request_uri".
Tags: :認証基盤, :クレームベース認証, :OAuth