メソッド: delegate
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
この呼び出しは、新しい認証 JSON Web Token(JWT)を返します。これにより、エンティティは元の認証 JWT で認証されたユーザーに代わって、指定されたリソースにアクセスできます。これは、ユーザーの代わりに別のエンティティが動作する必要がある場合に、ラップまたはアンラップへのスコープ付きアクセスを別のエンティティに委任するために使用されます。
HTTP リクエスト
POST https://<base_url>/delegate
<base_url>
は、Key Access Control List Service(KACLS)の URL に置き換えます。
パスパラメータ
なし。
リクエストの本文
リクエストの本文には、リクエストの JSON 表現が含まれています。
JSON 表現 |
{
"authentication": string,
"authorization": string,
"reason": string
}
|
フィールド |
authentication |
string
ユーザーが誰であるかをアサートするサードパーティによって発行された JWT。詳しくは、認証のセクションをご覧ください。
|
authorization |
string
delegated_to クレームで識別されるエンティティがユーザーに代わって resource_name にアクセスできることを表明する delegated_to クレームと resource_name クレームを含む JWT。詳細については、認証トークンをご覧ください。
|
reason |
string (UTF-8)
オペレーションに関する追加のコンテキストを提供するパススルー JSON 文字列。提供された JSON は、表示する前にサニタイズする必要があります。最大サイズ: 1 KB。
|
必要な処理手順
KACLS は、少なくとも次の手順を実行する必要があります。
- 認可トークンと認証トークンの両方を検証します。詳細については、認可トークンと認証トークンをご覧ください。
- 認可トークンと認証トークンが同じユーザーのものであることを確認します。詳細については、データの暗号化と復号をご覧ください。
- 認可トークンの
kacls_url
クレームが現在の KACLS URL と一致することを確認します。これにより、内部関係者や不正なドメイン管理者によって構成された潜在的な中間者サーバーを検出できます。
- 認証トークンに
kacls_owner_domain
クレームが存在する場合は、値が KACLS 所有者の Google Workspace ドメインと一致することを確認します。これにより、権限のないユーザーが KACLS を Google に登録することを防ぐことができます。
- オペレーションをログに記録します。これには、オペレーションを開始したユーザー、
delegated_to
、resource_name
、リクエストで渡された理由が含まれます。
- 認可トークンから
delegated_to
と resource_name
のクレームを含む JWT トークンを生成、署名して返します。
KACLS は、JWT クレームに基づくものなど、追加のセキュリティ チェックを自由に行うことができます。
レスポンスの本文
成功すると、このメソッドは delegated_to
クレームと resource_name
クレームを含む認証 JWT を返します。このトークンは、後で Wrap メソッドと Unwrap メソッドの呼び出しで認証に使用できます。エラーが発生した場合は、構造化されたエラー応答を返す必要があります。
JSON 表現 |
{
"delegated_authentication": string
}
|
フィールド |
delegated_authentication |
string
元の認証 JWT で言及されているユーザーが resource_name にアクセスするために有効な委任認証 JWT。詳細については、delegate の KACLS 認証トークンをご覧ください。
|
例
リクエスト
POST https://mykacls.example.com/v1/delegate
{
"authentication": "eyJhbGciOi...",
"authorization": "eyJhbGciOi...delegated_to\":\"other_entity_id\",\"resource_name\":\"meeting_id\"...}",
"reason": "{client:'meet' op:'delegate_access'}"
}
レスポンス
{
"delegated_authentication": "eyJhbGciOi...delegated_to_from_authz_token...resource_name_from_authz_token...}"
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# Method: delegate\n\nThis call returns a new authentication JSON Web Token (JWT) that allows\nan entity to access a specified resource on behalf of the user\nauthenticated in the original authentication JWT. It is used to delegate\nscoped access to [wrap](/workspace/cse/reference/wrap) or\n[unwrap](/workspace/cse/reference/unwrap) to another entity when that\nentity needs to act on behalf of the user.\n\n### HTTP request\n\n`POST https://\u003cbase_url\u003e/delegate`\n\nReplace `\u003cbase_url\u003e` with the Key Access Control List Service (KACLS) URL.\n\n### Path parameters\n\nNone.\n\n### Request body\n\nThe request body contains a JSON representation of the request:\n\n| JSON representation ||\n|---------------------------------------------------------------------------------|---|\n| ``` { \"authentication\": string, \"authorization\": string, \"reason\": string } ``` |\n\n| Fields ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `authentication` | `string` A JWT issued by a third-party asserting who the user is. See the authentication section for details. |\n| `authorization` | `string` A JWT with `delegated_to` and `resource_name` claims asserting that the entity identified by `delegated_to` claim is allowed to access `resource_name` on behalf of the user. For more information, see [Authorization Tokens](/workspace/cse/reference/authorization-tokens). |\n| `reason` | `string (UTF-8)` A passthrough JSON string providing additional context about the operation. The JSON provided should be sanitized before being displayed. Max size: 1 KB. |\n\n### Required processing steps\n\nThe KACLS must perform at least these steps:\n\n- Validate both authorization and authentication tokens. For more information, see [Authorization Tokens](/workspace/cse/reference/authorization-tokens) and [Authentication Tokens](/workspace/cse/reference/authentication-tokens).\n- Check that authorization and authentication tokens are for the same user. For more information, see [Encrypt and decrypt data](/workspace/cse/guides/encrypt-and-decrypt-data).\n- Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This allows detection of potential man-in-the-middle servers configured by insiders or rogue domain admins.\n- If the `kacls_owner_domain` claim exists in the authorization token, check that the value matches the KACLS owner's Google Workspace domain. This helps prevent unauthorized users from registering your KACLS with Google.\n- Log the operation, including the user originating it, the `delegated_to`, the `resource_name`, and the reason passed in the request.\n- Generate, sign, and return a JWT token containing `delegated_to` and `resource_name` claims from the authorization token.\n\nThe KACLS is free to perform additional security checks, including JWT claim\nbased ones.\n\n### Response body\n\nIf successful, this method returns an authentication JWT containing\n`delegated_to` and `resource_name` claims. This token can later be used for\nauthentication in calls to the Wrap and Unwrap methods. In case of an error, a\n[structured error reply](/workspace/cse/reference/structured-errors)\nshould be returned.\n\n| JSON representation ||\n|------------------------------------------------|---|\n| ``` { \"delegated_authentication\": string } ``` |\n\n| Fields ||\n|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `delegated_authentication` | `string` A delegated authentication JWT valid for accessing `resource_name` by the user mentioned in the original authentication JWT. For more information, see [KACLS authentication token for `delegate`](/workspace/cse/reference/authentication-tokens#kacls_authentication_token_for_delegate). |\n\n### Example\n\n#### Request\n\n POST https://mykacls.example.com/v1/delegate\n {\n \"authentication\": \"eyJhbGciOi...\",\n \"authorization\": \"eyJhbGciOi...delegated_to\\\":\\\"other_entity_id\\\",\\\"resource_name\\\":\\\"meeting_id\\\"...}\",\n \"reason\": \"{client:'meet' op:'delegate_access'}\"\n }\n\n#### Response\n\n {\n \"delegated_authentication\": \"eyJhbGciOi...delegated_to_from_authz_token...resource_name_from_authz_token...}\"\n }"]]