「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
以下、10章の変更点(強化)を一覧化
※ Sender Constraintとは、持参人切符 → 記名式切符の話。
※ 記名式切符には、クライアントの公開鍵サムプリント埋め込む。
※ Sender Constraintには、DPoP、mTLSがある。
以下、10章の変更点(廃止)を一覧化
以下、10章の変更点(修正)を一覧化
上記はOAuth2.1の必須の変更点だが、クライアント識別系のトピックは推奨(別仕様(BCP: RFC 9700等)に委ねる設計思想)。
private_key_jwt:Confidentialクライアントで、トークン・リクエスト時にASへのクライアント認証を行う。
※ OAuth 2.1 ではSender Constraintは、RTの利用が対象だが、ATにも適用はできる。
フローについて書いていく。
GET /authorize ?response_type=code &client_id=<client_id> &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &scope=openid%20profile%20email &state=<state> &code_challenge=BASE64URL(SHA256(ASCII(code_verifier))) &code_challenge_method=S256 Host: authserver.example.com
認証画面をパスした後にリダイレクトされる。
HTTP/1.1 302 Found Location: https://client.example.com/cb ?code=<auth_code>&state=<state>
※ 従来、Confidentialの場合「?」Publicの場合「#」でパラメタを送信すると良いと言われてきた。コレは、response_mode=query(デフォルト)/fragment で指定できる。
※ response_mode=fragment/form_postならサーバ・ログに出力されず、response_mode=query/form_postならクライアント・ログに出力されない。サーバ出力の方がマシなのでquery推奨らしい。
リダイレクトされた先はクライアントで、ソコから。
POST /token HTTP/1.1 Host: authserver.example.com Content-Type: application/x-www-form-urlencoded grant_type=authorization_code &code=<auth_code> &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &client_id=<client_id> &code_verifier=<code_verifier>
※ Confidentialの場合「Authorization: Basic BASE64(<client_id>:<client_secret>)」を追加しボディのclient_idを削除
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "eyJ...",
"scope": "openid profile email",
"id_token": "eyJ..."
}
※ refresh_token は、Publicクライアントには原則不発行
※ Publicクライアントにrefresh_tokenを発行するならローテーション化が必要。
※ しれっと「id_token」がある。と言う事は、OIDCにも対応(scopeにopenidがある)。
POST /token HTTP/1.1 Host: auth.example.com Authorization: Basic <base64(id:secret)> Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &scope=read:data write:data
POST /token HTTP/1.1 Host: auth.example.com Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=s6BhdRkqt3 &client_secret=gX1fBat3bV &scope=read:data write:data
POST /token HTTP/1.1 Host: auth.example.com Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=eyJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJpc3MiOi... &scope=read:data write:data
{ "access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "read:data write:data" }
※ refresh_token は発行しない(トークン期限切れ後は再度このフロー全体を実行する)
POST /device_authorization HTTP/1.1 Host: auth.example.com Content-Type: application/x-www-form-urlencoded client_id=<id> &scope=openid profile
{ "device_code": "GmRhmh...",
"user_code": "WDJB-MJHT",
"verification_uri": "https://auth/activate",
"expires_in": 1800,
"interval": 5 }
GET /activate?user_code=WDJB-MJHT
(ポーリング)
POST /token (grant_type=urn:ietf:params:oauth:grant-type:device_code)
(ポーリング)
{"error":"authorization_pending"} または {"error":"slow_down"}{ "access_token": "eyJ...","token_type": "Bearer", "refresh_token": "..." }Tags: :IT国際標準, :認証基盤, :クレームベース認証, :OAuth