> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Delegated Administration Extension（DAE）を使用して、Auth0 Dashboard の他の部分へのアクセスを許可せずに、選択したユーザーグループに Auth0 Dashboard の Users セクションを公開する方法を説明します。

# Delegated Administration Extension v3

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Auth0 では、組織内の他のユーザーや管理者にテナントの利用権限を設定するには、Tenant Members の設定を使用することを推奨しています。詳しくは、[Dashboard Access](/ja/docs/get-started/manage-dashboard-access) をご覧ください。
</Callout>

Delegated Administration Extension (DAE) を使用すると、他の領域へのアクセスを許可することなく、限られたユーザーグループに管理権限を付与できます。

<div id="configure-the-dae">
  ## DAE を設定する
</div>

DAE を設定するには、次の手順を実行します。

1. [アプリケーションを Auth0 に登録する](#register-the-application-with-auth0)
2. [データベース接続を作成する](#create-a-database-connection)
3. [Auth0 アプリケーションの他のすべての接続を無効にする](#disable-all-other-connections-for-the-auth0-application)
4. [データベース接続用のユーザーを作成する](#create-user-for-the-database-connection)
5. [ユーザーにロールを割り当てる](#assign-roles-to-users)
6. [拡張機能をインストールして設定する](#install-and-configure-the-extension)
7. [拡張機能を使用する](#use-the-extension)

<div id="register-the-application-with-auth0">
  ### アプリケーションをAuth0に登録する
</div>

Users ページの管理者権限を持つユーザー向けに Delegated Administration Extension が公開する Application を作成します。これを行うには、Auth0 で[委任管理アプリケーションを作成](/ja/docs/customize/extensions/delegated-administration-extension/create-delegated-admin-applications)します。

完了したら、そのアプリケーションの **<Tooltip tip="Client ID: Auth0 が登録済みリソースに付与する識別値。" cta="用語集を見る" href="/ja/docs/glossary?term=Client+ID">Client ID</Tooltip>** を控えておいてください。

<div id="create-a-database-connection">
  ### データベース接続を作成する
</div>

この例では、Users エリアへのアクセスを許可されたユーザーのソースとして、データベース接続を使用します。これを設定するには、[データベース接続を作成します](/ja/docs/get-started/applications/set-up-database-connections)。

接続の設定時には、次の点に注意してください。

* `HelpDesk` など、適切な接続名を使用します。
* **Disable Sign Ups** トグルを有効にします。セキュリティ上の理由から、これにより、データベース接続へのリンクを知っているユーザーでも、自分でサインアップできないようにします。

<div id="disable-all-other-connections-for-the-auth0-application">
  ### Auth0 アプリケーションの他のすべての接続を無効にする
</div>

デフォルトでは、新しい Application を作成すると、Auth0 はそのテナントに関連付けられているすべての接続を有効にします。この例では、新しく作成したデータベース接続以外の接続はすべて無効にしてください。こうすることで、既存の接続を使って第三者が自分で追加されることを防ぎ、アプリケーションのセキュリティ向上につながります。

設定方法については、[アプリケーション接続を更新する](/ja/docs/get-started/applications/update-application-connections) を参照してください。

<div id="create-users-for-the-database-connection">
  ### データベース接続用のユーザーを作成する
</div>

続行するには、[少なくとも1人のユーザーを作成し](/ja/docs/manage-users/user-accounts/create-users)、そのユーザーを接続に追加する必要があります。

<div id="assign-roles-to-users">
  ### ユーザーにロールを割り当てる
</div>

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  [Delegated Administration Extension (DAE)](/ja/docs/customize/extensions/delegated-administration-extension) と [Authorization Core](/ja/docs/manage-users/access-control/rbac) は完全に別の機能ですが、Authorization Core の機能セットを使うことで、Actions によって DAE 用のロールを作成および管理できます。詳しくは、[サンプルユースケース: Authorization と Actions](/ja/docs/manage-users/access-control/sample-use-cases-actions-with-authorization) をご覧ください。
</Callout>

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Organizations と Delegated Administration Extension (DAE) を使用してユーザーとしてログインした場合、ユーザーロールは利用できません。`event.authorization.roles.` 内で利用できるのは、Organization メンバーロールのみです。Organization メンバーにロールを追加する方法については、[Organization メンバーにロールを追加する](/ja/docs/manage-users/organizations/configure-organizations/add-member-roles) をご覧ください。
</Callout>

Auth0 は、接続に関連付けられたユーザーに対し、そのロールに基づいて Delegated Administration Extension (DAE) へのアクセスを付与します。以下は DAE 固有のロールです。

| このロール...                          | 付与される権限...                                                              |
| --------------------------------- | ----------------------------------------------------------------------- |
| `Delegated Admin - User`          | ユーザーの検索、作成、表示、およびユーザーに対するアクション (削除やブロックなど) の実行。                         |
| `Delegated Admin - Administrator` | Delegated Admin - User ができることをすべて実行でき、さらにテナント内のすべてのログの閲覧と Hooks の設定が可能。 |
| `Delegated Admin - Auditor`       | ユーザーの検索とユーザー情報の閲覧は可能ですが、変更はできません。アクションベースのボタンはこのロールには表示されません。           |
| `Delegated Admin - Operator`      | ユーザー管理とログにはアクセスできますが、拡張機能の設定セクションにはアクセスできません。                           |

ロールを扱う際は、[Authorization Core](/ja/docs/manage-users/access-control/rbac) の機能セットを使用することをおすすめします。

1. [DAE ロールを作成する](/ja/docs/manage-users/access-control/configure-core-rbac/roles/create-roles)。作成するロール名は、上記の事前定義された DAE ロール名と一致している必要があります。
2. [DAE ロールを手動でユーザーに割り当てる](/ja/docs/manage-users/access-control/configure-core-rbac/rbac-users/assign-roles-to-users)。
3. [Actions](/ja/docs/customize/actions) を使用して、ID トークン内の DAE 名前空間にユーザーロールを追加します\*\*:\*\*

   ```text lines theme={null}
   exports.onExecutePostLogin = async (event, api) => {
     const namespace = `https://{yourTenant}/auth0-delegated-admin`;
     if (event.client.client_id === 'CLIENT_ID' && event.authorization) {
       api.idToken.setCustomClaim(namespace, { "roles": event.authorization.roles });
     }
   };
   ```

`CLIENT_ID` プレースホルダーは delegated admin アプリケーションの **Client ID** に、`{yourTenant}` はテナント名に置き換えてください。たとえば、テナント名が "tenant\_name\_example" の場合、名前空間は次のようになります: `https://tenant_name_example/auth0-delegated-admin`

Actions の作成方法について詳しくは、[初めての Action を作成する](/ja/docs/customize/actions/write-your-first-action) をご覧ください。

<Warning>
  Auth0 は、[OpenID Connect (OIDC) specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) で定義されている構造化クレーム形式でプロフィール情報を返します。つまり、衝突の可能性を避けるため、ID トークンまたはアクセストークンに追加するカスタムクレームは、[ガイドラインと制限事項](/ja/docs/secure/tokens/json-web-tokens/create-custom-claims) に準拠している必要があります。
</Warning>

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Authorization Core を使用すると、`context.authorization` オブジェクトにロールが定義されます。

  Authorization Core を使用しない場合は、ユーザープロフィールの次のいずれかのフィールドに DAE ロールを定義する必要があります。

  * `user.app_metadata.roles`
  * `user.app_metadata.authorization.roles`
</Callout>

<div id="install-and-configure-the-extension">
  ## 拡張機能をインストールして設定する
</div>

アプリケーション、接続、ユーザーの作成と設定が完了したので、次は [Delegated Admin Extension 自体をインストールして設定](/ja/docs/customize/extensions/delegated-administration-extension/install-delegated-admin-extension) します。

<div id="use-the-extension">
  ## 拡張機能を使用する
</div>

インストールが完了したら、Delegated Admin Extension を使用できます。

お使いのリージョンと、テナントの extensibility runtime に対応するログインリンクを使用して、拡張機能にアクセスします。

| 場所        | 名前   | ログインリンク                                                     |
| --------- | ---- | ----------------------------------------------------------- |
| Australia | AU   | `https://{yourTenant}.au.webtask.io/auth0-delegated-admin`  |
| Europe    | EU   | `https://{yourTenant}.eu.webtask.io/auth0-delegated-admin`  |
| Europe    | EU-2 | `https://{yourTenant}.eu.webtask.run/auth0-delegated-admin` |
| Japan     | JP-1 | `https://{yourTenant}.jp.webtask.run/auth0-delegated-admin` |
| UK        | UK   | `https://{yourTenant}.uk.webtask.run/auth0-delegated-admin` |
| USA       | US-1 | `https://{yourTenant}.us.webtask.io/auth0-delegated-admin`  |
| USA       | US-3 | `https://{yourTenant}.us.webtask.run/auth0-delegated-admin` |

新しいタブが開き、ログイン画面が表示されます。

(この例では) 設定時にデータベース接続のサインアップを無効にしているため、ログイン画面には **Sign Up** オプションは表示されません。
有効な認証情報を入力すると、Auth0 によってカスタムの **Delegated Administration Dashboard** ページが表示されます。このページの上部には指定した **Title** が表示され、 (カスタム CSS ファイルを指定している場合は) そのデザインが反映されます。

<Card title="Delegated Administration のセッションタイムアウト">
  デフォルトでは、トークンの有効期限は 10 時間です。ただし、セキュリティ上の理由から、Delegated Administration を使用する場合、Auth0 はトークンを Cookie や `sessionStorage` に保存しません。そのため、ページを再読み込みするたびに新しいセッションを開始する必要があります。
</Card>

<div id="learn-more">
  ## 詳しく見る
</div>

* [Delegated Administration: 拡張機能フック](/ja/docs/customize/extensions/delegated-administration-extension/delegated-administration-hooks)
* [Delegated Administration: ユーザー管理](/ja/docs/customize/extensions/delegated-administration-extension/delegated-administration-manage-users)
