マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。

目次

概要

AIによる要約

略語まとめ

強化

以下、10章の変更点(強化)を一覧化

※ Sender Constraintとは、持参人切符 → 記名式切符の話。
※ 記名式切符には、クライアントの公開鍵サムプリント埋め込む。
※ Sender Constraintには、DPoPmTLSがある。

廃止

以下、10章の変更点(廃止)を一覧化

修正

以下、10章の変更点(修正)を一覧化

クライアント認証系

上記はOAuth2.1の必須の変更点だが、クライアント認証系のトピックは推奨(別仕様(BCP: RFC 9700等)に委ねる設計思想)。

トークン・リクエスト時

private_key_jwt:Confidentialクライアントで、トークンリクエスト時にASへのクライアント認証を行う。

トークン利用時

Publicクライアントで、

※ OAuth 2.1 ではSender Constraintは、RTの利用が対象だが、ATにも適用はできる。

詳細

フローについて書いていく。

Authorization Code + PKCE

認可リクエスト

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がある)。

Client Credentials

リクエスト

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

※ 認証は以下の何れかで行う。

レスポンス

{ "access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "read:data write:data" }

※ refresh_token は発行しない(トークン期限切れ後は再度このフロー全体を実行する)

Device Authorization

認可リクエスト

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)

トークン・レスポンス

(ポーリング)

参考


Tags: :IT国際標準, :認証基盤, :クレームベース認証, :OAuth


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS