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

目次

概要

特徴

モジュラーデザイン

ユースケースに対応するため、

多様な環境をサポートできる。

プロトコル概要

ざっくり、リクエスト→認証・認可→ユーザ情報を取得。

+--------+                                   +--------+
|        |                                   |        |
|        |---------(1) AuthN Request-------->|        |
|        |                                   |        |
|        |  +--------+                       |        |
|        |  |        |                       |        |
|        |  |  End-  |<--(2) AuthN & AuthZ-->|        |
|        |  |  User  |                       |        |
|   RP   |  |        |                       |   OP   |
|        |  +--------+                       |        |
|        |                                   |        |
|        |<--------(3) AuthN Response--------|        |
|        |                                   |        |
|        |---------(4) UserInfo Request----->|        |
|        |                                   |        |
|        |<--------(5) UserInfo Response-----|        |
|        |                                   |        |
+--------+                                   +--------+

OAuth 2.0への認証拡張

OAuth 2.0との違いは、認証拡張機能が追加実装された点にある。

仕様の柱

フロー

OAuth 2.0に認証結果とプロフィールの受渡し機能を追加。

ID トークン

追加のエンドポイント

フロー

概要

フロー選択の指針

特定のコンテキストにおいてどのフローを選択すればよいかの指針

#PropertyAuthorization Code FlowImplicit FlowHybrid Flow
1全てのトークンは Authorization Endpoint から返却されるnoyesno
2全てのトークンは Token Endpoint から返却されるyesnono
3トークンが User Agent に渡らないyesnono
4Client 認証が可能であるyesnoyes
5Refresh Token を利用できるyesnoyes
6通信が1往復だけであるnoyesno
7殆どの通信がサーバ間通信であるyesnovaries

response_type 値とフローの対応

どのフローを利用するかを決定する response_type 値とフローの対応

#response_type valueFlow
1codeAuthorization Code Flow
2id_tokenImplicit Flow
3id_token tokenImplicit Flow
4code id_tokenHybrid Flow
5code tokenHybrid Flow
6code id_token tokenHybrid Flow

追加のリクエスト・パラメタ

追加のレスポンス・パラメタ

TLS要件

以下との通信は、TLS を用いなければならない (MUST).

その他の追加要件

Authorization Code Flow

概要

OAuth 2.0 からのステップ上の拡張部分は無い。

ただし、

ステップ

朱書きは、OAuth 2.0 からのステップ上の変更・拡張部分。

The Authorization Code Flow goes through the following steps.

  1. Client prepares an Authentication Request containing the desired request parameters.
  2. Client sends the request to the Authorization Server.
  3. Authorization Server Authenticates the End-User.
  4. Authorization Server obtains End-User Consent/Authorization.
  5. Authorization Server sends the End-User back to the Client with an Authorization Code.
  6. Client requests a response using the Authorization Code at the Token Endpoint.
  7. Client receives a response that contains an ID Token and Access Token in the response body.
  8. Client validates the ID token and retrieves the End-User's Subject Identifier.

Implicit Flow

概要

ステップ

朱書きは、OAuth 2.0 からのステップ上の変更・拡張部分。

The Implicit Flow follows the following steps:

  1. Client prepares an Authentication Request containing the desired request parameters.
  2. Client sends the request to the Authorization Server.
  3. Authorization Server Authenticates the End-User.
  4. Authorization Server obtains End-User Consent/Authorization.
  5. Authorization Server sends the End-User back to the Client with an ID Token and, if requested, an Access Token.
  6. Client validates the ID token and retrieves the End-User's Subject Identifier.

Hybrid Flow

概要

ID トークンと同時に、アクセストークンや認可コードが一緒に発行される。

ステップ

朱書きは、Authorization Code Flowとの差異。

The Hybrid Flow follows the following steps:

  1. Client prepares an Authentication Request containing the desired request parameters.
  2. Client sends the request to the Authorization Server.
  3. Authorization Server Authenticates the End-User.
  4. Authorization Server obtains End-User Consent/Authorization.
  5. Authorization Server sends the End-User back to the Client with an Authorization Code and,
    depending on the Response Type, one or more additional parameters.
  6. Client requests a response using the Authorization Code at the Token Endpoint.
  7. Client receives a response that contains an ID Token and Access Token in the response body.
  8. Client validates the ID Token and retrieves the End-User's Subject Identifier.

ポイント

主要な仕様

IDトークン

暗号関連

ユーザー属性

ユーザー属性クレーム群

ユーザー情報エンドポイント

Discovery、Dynamic Client Registration

Discovery

http://openid.net/specs/openid-connect-discovery-1_0.html

メールアドレスやURLからユーザが利用しているIdp(OP)を特定する方法

Dynamic Client Registration

http://openid.net/specs/openid-connect-registration-1_0.html

(Discoveryで発見したIdp(OP)に、)動的なRP登録を行う方法

追加の仕様

追加された仕様についてまとめる。

追加の応答タイプ (response_type)

追加の応答モード (response_mode)

追加のクライアント認証

Client Registrationの際、Tokenエンドポイントにアクセスする際に追加のクライアント認証を登録可能。
(パラメタ名は明記されていないが、ClientAuthentication?的な名称でconfigすると思われる。)

client_secret_XXXX

jwt

none

以下のケースでTokenエンドポイントでの認証を行わない場合。

オプションの仕様

Session Management

http://openid.net/specs/openid-connect-session-1_0.html

Idp(OP)上でユーザーがログアウトしたときにRP側から検知する方法など、セッション管理の方法

claimsリクエスト・パラメタ

認証コンテキストクラス

クライアントアプリケーションは、認証コンテキストクラスを使用して、
ユーザー認証時に満たして欲しい認証コンテキストクラスを指定する。

識別子

Authentication Context Class Reference(ACR)識別子。

要求方法

arcクレームを

要求できる。

参考

リクエスト・オブジェクト

JWT Secured Authorization Request (JAR)

考慮点

実装

認可画面

セキュリティ

参考

Qiita

TakahikoKawasaki?

OpenID Foundation

OpenID ファウンデーション・ジャパン

Client Implementer's Guide

WebアプリケーションのClientに当該フローを実装する場合の実装ガイド。

IdM実験室

WIF

WIF Extension for OAuthは古い?

OWIN

Microsoft.Owin.Security.OpenIdConnect?

ADFS

OpenID Connectのシーケンス

STEP 0 は事前準備なので、STEP 1 からが実際の認証・認可のシーケンス。

Webアプリ(Basic Client Profile)

モバイルアプリ(Implicit Client Profile)

結果的に、OPからRP識別のための“cient_id”がレスポンスされる。

OpenId? Connectのサンプル

Microsoft.Owin.Security.OpenIdConnect?

AzureADに対して、OpenId? Connectを使用して認証する。

https://github.com/OpenTouryoProject/SampleProgram/tree/master/ASPNET/AuthN_AuthZ/OpenID_Connect/

Microsoft Azure Active Directory

Azure Active Directory B2C


Tags: :認証基盤, :クレームベース認証, :OAuth


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