マイクロソフト系技術情報 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-----|        |
|        |                                   |        |
+--------+                                   +--------+

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.

ポイント

主要な仕様

IDトークン

暗号関連

ユーザー属性

ユーザー属性クレーム群

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

Discovery、Dynamic Client Registration

Discovery

Dynamic Client Registration

追加の仕様

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

追加の応答タイプ (response_type)

追加の応答モード (response_mode)

オプションの仕様

認証コンテキスト クラス

Requestオブジェクト

追加のクライアント認証?

Self-Issued OP

Initiating Login from a Third Party

Session Management

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

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

考慮点

実装

認可画面

セキュリティ

参考

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: :IT国際標準, :認証基盤, :クレームベース認証, :OAuth


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