Open棟梁Project - マイクロソフト系技術情報 Wiki

目次

概要

変遷

OAuth 1.0

OAuth 2.0

OAuth 1.0とOAuth 2.0の違い

  1. HTTPSを必須にし、署名をなくし、トークン取得も簡略化
  2. アクセストークンのみでリソース取得が可能に
  3. Webアプリも含め、4つのクライアントプロファイルを仕様化
    1. Webサーバ(Web Server)
      Webアプリケーション
    2. ユーザーエージェント(User-Agent)
      JavaScript
    3. ネイティブアプリ(Native Application)
      モバイルやデスクトップアプリ(ガイドライン程度しか定義されていない)
    4. 自立クライアント(Autonomous)
      既存の認証フレームワークとSAMLなどのプロトコルを使って連携する場合のフロー。

Bearer Token Usage

OAuthの利用例

Instagramで共有した写真をFacebookやTwitterにも投稿

Instagramの設定画面から複数の外部サービスと連携するように設定できる。

Facebook Twitter IDでほかのサイトにログイン

「Facebook IDでログイン」や「Twitter IDでログイン」といったボタンで利用されている。

The OAuth 2.0 Authorization Framework

OAuth 2.0のフロー定義

OAuth 2.0仕様には4つのフローが定義されている。
これらのフローのタイプを「グラント種別」と呼ばれる。

以下の様な「グラント種別」がある模様。

Authorization Codeグラント種別

Note: The lines illustrating steps (A), (B), and (C) are broken into two parts as they pass through the user-agent.

Implicitグラント種別

Note: The lines illustrating steps (A) and (B) are broken into two parts as they pass through the user-agent.

Resource Owner Password Credentialsグラント種別

Client Credentialsグラント種別

RFC 6749 - 4.3. Resource Owner Password Credentials Grant

RFC 6750 - Bearer Token Usage

 +--------+                               +---------------+
 |        |--(A)- Authorization Request ->|   Resource    |
 |        |                               |     Owner     |
 |        |<-(B)-- Authorization Grant ---|               |
 |        |                               +---------------+
 |        |
 |        |                               +---------------+
 |        |--(C)-- Authorization Grant -->| Authorization |
 | Client |                               |     Server    |
 |        |<-(D)----- Access Token -------|               |
 |        |                               +---------------+
 |        |
 |        |                               +---------------+
 |        |--(E)----- Access Token ------>|    Resource   |
 |        |                               |     Server    |
 |        |<-(F)--- Protected Resource ---|               |
 +--------+                               +---------------+

OAuthのFlow

Authorization Code Flow

Step 0:Client Registration

準備

Step 1:Initiate

Flowの開始

Step 2:Authorization Request

ユーザ認証とアクセス権限付与のリクエスト

Step 3:Authenticate User & Get Approval

ユーザ認証とアクセス権限付与

Step 4:Authorization Response

ユーザ認証とアクセス権限付与の結果をレスポンス

Step 5:Obtain Access Token

Step 6:API Access

APIへのアクセス

参考

1.0

2.0


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