クライアント登録要求を受け入れるための OpenID Connect プロバイダーの構成

クライアント登録エンドポイントは、OpenID Connect プロバイダーを使用しようとする OpenID Connect リライング・パーティーに関する情報を登録、更新、削除、取得するための管理者の管理対象サービスです。 代わりに、登録プロセスは、リライング・パーティーがそれを使用するための情報 (OAuth 2.0 クライアント ID やクライアント秘密鍵など) を未指定の場合に提供できます。

始める前に

クライアント登録サービスは、ローカル・ストアまたはデータベース・ストアの 2 つのいずれかのモードで動作します。 Liberty サーバーがそのクライアント・ストアをどのように構成するか、 クライアントが server.xml ファイルの oauthProvider localStore 属性で定義されるか (ローカル・ストア)、データベースで構成されるか (データベース・ストア) によって、 これらのモードは決まります。

ローカル・ストア構成では、クライアント登録サービスが OpenID Connect リライング・パーティー情報の取得のみに限定されます。 server.xml ファイルを変更して、OpenID Connect リライング・パーティーを登録、更新、または削除する操作をさらに追加できます。

データベース・ストア構成では、クライアント登録サービスの制限はありません。すべての操作が REST インターフェースを通じて機能します。

注: Liberty サーバーは、ローカル・ストアとデータベース・ストアの両方でそのクライアント・ストアを構成してはなりません。 構成ルートを 1 つのみ選択してください。

クライアント登録エンドポイントは、 clientManager ロールの保護された管理エンドポイントです。 このエンドポイントにアクセスするには、そのユーザーに clientManager ロールが管理者から付与される必要があります。

clientManager ロールは、oauthProvider に定義された oauth-roles の 1 つです。 以下は、ユーザー Alice、または clientAdministrator グループのメンバーに対する clientManager ロールの付与を示したサンプル構成です。

<oauth-roles>
<authenticated>
<special-subject type="ALL_AUTHENTICATED_USERS" />
</authenticated>
<clientManager>
<group name="clientAdministrator" />
<user name="Alice" />
</clientManager>
</oauth-roles>

このタスクについて

OpenID Connect リライング・パーティーに関するクライアント登録情報は、クライアントの使用シナリオ制約の定義に主として使用されます。 さらに、クライアントに不透明な他の OP 操作は、クライアント登録メタデータを使用して許可決定を行います。

次の例は、Liberty OP がポート 443 で SSL を使用して構成されていることを想定しています。

https://server.example.com:443/oidc/endpoint/<provider_name>/registration

また、前出の例では、oauth-role: clientManager を使用するユーザー名: clientAdmin、パスワード: clientAdminPasswordserver.xml ファイルが構成されていることを想定しています。

クライアント登録メタデータは、以下のパラメーターから構成されます。

表 1. クライアント登録パラメーター
属性名 データ・タイプ 必須/オプション 説明
client_id 入出力 オプション OP に登録されるクライアント ID。 指定されない場合、このパラメーター値はデフォルトで登録中に生成されます。 これはストリングです。
client_secret 入出力 オプション OP に登録されるクライアント秘密鍵。 指定されない場合、このパラメーター値はデフォルトで登録中に生成されます。 これはストリングです。パラメーター値が「*」の場合、更新操作で既存の値を保持します。パラメーター値がブランクの場合は、新しい client_secret を生成します。 非ブランクのパラメーター値は、新しく指定した値で既存の値をオーバーライドします。
client_name 入出力 オプション OP に登録されるクライアントの説明。 指定されない場合、このパラメーターはデフォルトで client_id パラメーターの値に設定されます。 これはストリングです。
application_type 入力 オプション クライアントを記述するアプリケーション・タイプ。 指定されない場合、デフォルト値は web です。 これはストリングです。例えば、以下の値が可能です。
  • <空値は有効です>
  • web
  • native
response_types 入力 オプション このクライアントによって使用される応答タイプ制約。 指定されない場合、デフォルト値は code です。 これは、JSON 配列です。 例えば、次の値を指定できます。
  • <空値は有効です>
  • code
  • token
  • id_token token (順序は可逆)

特定の response_type に対して、 対応する grant_types を指定する必要があります。 詳しくは、Client Metadata の Web サイトの「response_types」を参照してください。

grant_types 入力 オプション このクライアントによって使用される付与タイプ制約。 指定されない場合、デフォルト値は authorization_code です。 これは、JSON 配列です。 例えば、以下の値が可能です。
  • <空値は有効です>
  • authorization_code
  • implicit
  • refresh_token
  • client_credentials
  • urn:ietf:params:oauth:grant-type:jwtbearer
  • password
redirect_uris 入力 オプション クライアントが制約されるリダイレクト URI の配列。 これは、JSON 配列です。
post_logout_redirect_uris 入力 オプション クライアントが制約されるポスト・ログアウト・リダイレクト URI の配列。 これは、JSON 配列です。
trusted_uri_prefixes 入力 オプション アクセス・トークンの送信にクライアントが安全と見なしたトラステッド URI 接頭部の配列。 これは、JSON 配列です。
scope 入力 オプション クライアントが制約される有効範囲値 (スペース区切り)。 これはストリングです。クライアントが有効範囲の要求を許可される場合、ALL_SCOPES の値を使用できます。
preauthorized_scope 入力 オプション ユーザーの同意を必要としないクライアントが事前許可している有効範囲値 (スペース区切り)。 これはストリングです。
subject_type 入力 オプション クライアントによって記述されたサブジェクト・タイプの制約。 これはストリングです。例えば、次の値を指定できます。
  • <空値は有効です>
  • public
token_endpoint_auth_method 入力 オプション クライアントによって使用されるトークン・エンドポイント認証方式の制約。 指定されない場合、デフォルト値は client_secret_basic です。 これはストリングです。例えば、次の値を指定できます。
  • <空値は有効です>
  • client_secret_basic
  • client_secret_post
  • none
functional_user_id 入力 オプション このパラメーターは、client_credentials 付与タイプでクライアントに代わって行われた要求に関連付けるユーザー ID を示します。 これはストリングです。
functional_user_groupIds 入力 オプション このクライアントがクライアント・クレデンシャルの付与タイプを使用して取得したアクセス・トークンに関連付けるグループ ID のリスト。 この値は、機能ユーザーがメンバーとなっているグループ ID のリストです。ここで、グループ ID は、大/小文字を区別するストリングです。 このストリングは、許可サーバーによって定義されます。 値に複数のグループ ID が含まれる場合、その順序は重要ではありません。 リストが空の場合、クレームは省略されます。 このクライアント・メタデータ・パラメーターが指定されると、値は、クライアント・クレデンシャルの付与でこのクライアントに発行されたアクセス・トークンのイントロスペクション・エンドポイントからの functional_user_groupIds 応答パラメーターで返されます。 functional_user_id パラメーターが使用されない場合、このパラメーターは無視されます。
注: 許可サーバーは、クライアントによるこのパラメーターの自己表明を信頼してはなりません。
introspect_tokens 入力 オプション OP で発行されたアクセス・トークンをイントロスペクトする権限が、指定されたクライアントにあるかどうかを示すパラメーター値。 これはブール値です。
registration_client_uri 出力のみ N/A 登録クライアントの固有 URL を示す値を含み、応答で返されるパラメーター。 これはストリングです。
client_secret_expires_at 出力のみ N/A クライアント秘密鍵の有効期限を表す、UTC で測定された 1970-01- 01T0:0:0Z からの秒数を示す値を含み、応答で返されるパラメーター。 値 0 は、有効期限がないことを示します。
client_id_issued_at 出力のみ N/A クライアント ID の発行時刻を表す、UTC で測定された 1970-01- 01T0:0:0Z からの秒数を示す値を含み、応答で返されるパラメーター。 値 0 は、クライアント ID 発行時刻が識別されなかったことを示します。

手順

  1. 以下の例のようにして、クライアントを登録します。

    Request Headers:

    POST https://server.example.com:443/oidc/endpoint/<provider_name>/registration
    Accept: application/json
    Content-Type: application/json
    Authorization: Basic Y2xpZW50QWRtaW46Y2xpZW50QWRtaW5QYXNzd29yZA==

    Request Payload:

    {
       "token_endpoint_auth_method":"client_secret_basic",
       "scope":"openid profile email general",
       "grant_types":[
          "authorization_code",
          "client_credentials",
          "implicit",
          "refresh_token",
          "urn:ietf:params:oauth:grant-type:jwt-bearer"
       ],
       "response_types":[
          "code",
          "token",
          "id_token token"
       ],
       "application_type":"web",
       "subject_type":"public",
       "post_logout_redirect_uris":[
          "https://server.example.com:9000/logout/",
          "https://server.example.com:9001/exit/"
       ],
       "preauthorized_scope":"openid profile email general",
       "introspect_tokens":true,
       "trusted_uri_prefixes":[
          "https://server.example.com:9000/trusted/"
       ],
       "redirect_uris":[
          "https://server.example.com:443/resource/redirect1",
          "https://server.example.com:9000/resource/redirect2"
       ]
    }

    Response Headers:

    Status: 201
    Cache-Control: private
    ETag: "1B2M2Y8AsgTpgAmY7PhCfg=="
    Content-Type: application/json

    Response Body:

    {
       "client_id_issued_at":1401776782,
       "registration_client_uri":"https://server.example.com:8020/oidc/endpoint/OIDC/registration/b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret_expires_at":0,
       "token_endpoint_auth_method":"client_secret_basic",
       "scope":"openid profile email general",
       "grant_types":[
          "authorization_code",
          "client_credentials",
          "implicit",
          "refresh_token",
          "urn:ietf:params:oauth:grant-type:jwt-bearer"
       ],
       "response_types":[
          "code",
          "token",
          "id_token token"
       ],
       "application_type":"web",
       "subject_type":"public",
       "post_logout_redirect_uris":[
          "https://server.example.com:9000/logout/",
          "https://server.example.com:9001/exit/"
       ],
       "preauthorized_scope":"openid profile email general",
       "introspect_tokens":true,
       "trusted_uri_prefixes":[
          "https://server.example.com:9000/trusted/"
       ],
       "client_id":"b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret":"nmrOQ20CrMdwd4pjqaimutZTcbQPzIoYgItjaccb9Wk33rKarhM3WDLmWIoE",
       "client_name":"b0a376ec4b694b67b6baeb0604a312d8",
       "redirect_uris":[
          "https://server.example.com:443/resource/redirect1",
          "https://server.example.com:9000/resource/redirect2"
       ]
    }
  2. 以下の例のようにして、クライアントを更新します。

    Request Headers:

    PUT https://server.example.com:443/oidc/endpoint/<provider_name>/registration/registration/b0a376ec4b694b67b6baeb0604a312d8
    Accept: application/json
    Content-Type: application/json
    Authorization: Basic Y2xpZW50QWRtaW46Y2xpZW50QWRtaW5QYXNzd29yZA==

    Request Payload:

    {
       "token_endpoint_auth_method":"client_secret_basic",
       "scope":"openid profile",
       "grant_types":[
          "authorization_code"
       ],
       "response_types":[
          "code"
       ],
       "application_type":"native",
       "subject_type":"public",
       "post_logout_redirect_uris":[
          "https://server.example.com:9000/logout/"
       ],
       "preauthorized_scope":"openid",
       "introspect_tokens":false,
       "trusted_uri_prefixes":[
          "https://server.example.com:9003/trusted/"
       ],
       "client_id":"b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret":"*",
       "client_name":"updated client",
       "redirect_uris":[
          "https://server.example.com:443/resource/redirect1"
       ]
    }

    Response Headers:

    Status: 200
    ETag: "3DD7affTGS91mfhPZ83B39Y=="
    Content-Type: application/json

    Response Body:

    {
       "client_id_issued_at":1401776782,
       "registration_client_uri":"https://server.example.com:8020/oidc/endpoint/OIDC/registration/b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret_expires_at":0,
       "token_endpoint_auth_method":"client_secret_basic",
       "scope":"openid profile",
       "grant_types":[
          "authorization_code"
       ],
       "response_types":[
          "code"
       ],
       "application_type":"native",
       "subject_type":"public",
       "post_logout_redirect_uris":[
          "https://server.example.com:9000/logout/"
       ],
       "preauthorized_scope":"openid",
       "introspect_tokens":false,
       "trusted_uri_prefixes":[
          "https://server.example.com:9003/trusted/"
       ],
       "client_id":"b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret":"*",
       "client_name":"updated client",
       "redirect_uris":[
          "https://server.example.com:443/resource/redirect1"
       ]
    }
  3. 以下の例のようにして、クライアントを取得します。

    Request Headers:

    GET https://server.example.com:443/oidc/endpoint/<provider_name>/registration/registration/b0a376ec4b694b67b6baeb0604a312d8
    Accept: application/json
    Authorization: Basic Y2xpZW50QWRtaW46Y2xpZW50QWRtaW5QYXNzd29yZA==

    Response Headers:

    Status: 200
    Cache-Control: private
    ETag: "3DD7affTGS91mfhPZ83B39Y=="
    Content-Type: application/json

    Response Body:

    {
       "client_id_issued_at":1401776782,
       "registration_client_uri":"https://server.example.com:8020/oidc/endpoint/OIDC/registration/b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret_expires_at":0,
       "token_endpoint_auth_method":"client_secret_basic",
       "scope":"openid profile",
       "grant_types":[
          "authorization_code"
       ],
       "response_types":[
          "code"
       ],
       "application_type":"native",
       "subject_type":"public",
       "post_logout_redirect_uris":[
          "https://server.example.com:9000/logout/"
       ],
       "preauthorized_scope":"openid",
       "introspect_tokens":false,
       "trusted_uri_prefixes":[
          "https://server.example.com:9003/trusted/"
       ],
       "client_id":"b0a376ec4b694b67b6baeb0604a312d8",
       "client_secret":"*",
       "client_name":"updated client",
       "redirect_uris":[
          "https://server.example.com:443/resource/redirect1"
       ]
    }
  4. 以下の例のようにして、クライアント (ヘッド要求) を取得します。

    Request Headers:

    HEAD https://server.example.com:443/oidc/endpoint/<provider_name>/registration/registration/b0a376ec4b694b67b6baeb0604a312d8
    Accept: application/json
    Authorization: Basic Y2xpZW50QWRtaW46Y2xpZW50QWRtaW5QYXNzd29yZA==

    Response Headers:

    Status: 200
    Cache-Control: private, no-cache=set-cookie
    ETag: "3DD7affTGS91mfhPZ83B39Y=="
    Content-Type: application/json
  5. 以下の例のようにして、クライアントを削除します。

    Request Headers:

    DELETE https://server.example.com:443/oidc/endpoint/<provider_name>/registration/registration/b0a376ec4b694b67b6baeb0604a312d8
    Authorization: Basic Y2xpZW50QWRtaW46Y2xpZW50QWRtaW5QYXNzd29yZA==

    Response Headers:

    Status: 204
    Content-Length: 0
    Content-Language: en-US
    注: このトピックの情報は、OAuth 2.0 クライアント、および OpenID Connect リライング・パーティーのクライアント登録サービスにも適用されます。

トピックのタイプを示すアイコン タスク・トピック



タイム・スタンプ・アイコン 最終更新: Tuesday, 6 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_client_registration
ファイル名: twlp_client_registration.html