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

目次

概要

Finalを参照して記述。

特徴

モジュラーデザイン

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

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

プロトコル概要

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

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

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 値とフローの対応

メッセージのシリアライズ方法

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

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

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.

ポイント

主要な仕様

subクレームの種類

(Subject Identifier Types)

種類

サポート

pairwiseの値

pairwiseのsubクレーム値

IDトークン

暗号関連

ユーザー属性

ユーザー属性クレーム群

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

追加の仕様

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

追加の応答タイプ (response_type)

追加の応答モード (response_mode)

オプションの仕様

認証コンテキスト クラス

Requestオブジェクト

クライアント認証

Self-Issued OP

CIBA Flow

その他

Offline Access

offline_access scopeにより、

Session Management

ログイン開始エンドポイント

アプリXのログイン・フローが、サード・パーティーの
Client(RP)やIdP/STS(OP)によって開始される仕組み。

考慮点

IdP/STS(OP)の実装

必須の実装

Client(RP)次第の実装

Discovery、Dynamic Client Registration

事前登録のない Client(RP) と IdP/STS(OP) 間の
予期しないやりとりをサポートすることを選択した場合に実装が必要。

セキュリティ

OAuth 2.0 Threat Model and Security Considerations

サーバ認証

ID Tokenの署名・暗号化で提供される。

トークン

暗号化

Requestオブジェクト

リクエストの漏洩や改ざんの防止

参考

OpenID Foundation

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

Client Implementer's Guide

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

Qiita

TakahikoKawasaki?

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)

結果的に、IdP/STS(OP)からClient(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

子ページ

IDトークン

ユーザー属性クレーム関連

暗号関連

Discovery

Dynamic Client Registration

クライアント認証

認証コンテキスト クラス

Requestオブジェクト

Self-Issued OP

CIBA Flow


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


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