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

# Auth0 Management APIを使用してユーザーのセッションを管理する

> Auth0 Management APIでユーザートークンを管理する方法について説明します。

Auth0は要求間でユーザーの認証状態を維持するために、[セッション](/docs/ja-JP/ja-jp/manage-users/sessions)を使用します。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Auth0 Management APIのセッション管理エンドポイントは、エンタープライズプランでのみ利用できます。詳細については、「[価格設定](https://auth0.com/pricing)」をお読みください。
</Callout>

<div id="management-api-endpoints">
  ## Management APIエンドポイント
</div>

[Management API](/docs/ja-JP/ja-jp/api/management/v2)は、[Auth0セッションレイヤー](/docs/ja-JP/ja-jp/manage-users/sessions/session-layers)にあるユーザーセッションの内部に帯域外アクセスを提供し、セッションを強制終了するために削除メソッドを提供します。

<div id="session-resource">
  ### セッションリソース
</div>

特定のセッションを表示または削除するには、以下のエンドポイントを使用できます。

<table class="table">
  <thead>
    <tr>
      <th><strong>名前</strong></th>
      <th><strong>URL</strong></th>
      <th><strong>必要なスコープ</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Introspect a specific session by ID（特定のセッションをID別にイントロスペクトする）</td>
      <td>`GET /api/v2/sessions/{sessionId}`</td>
      <td>`read:sessions`</td>
    </tr>

    <tr>
      <td>Delete a specific session by ID（特定のセッションをIDで削除する）</td>
      <td>`DELETE /api/v2/sessions/{sessionId}`</td>
      <td>`delete:sessions`</td>
    </tr>
  </tbody>
</table>

<div id="user-resource">
  ### ユーザーリソース
</div>

特定のユーザーに対するすべてのセッションを一覧表示または削除するには、以下のエンドポイントを使用できます。

<table class="table">
  <thead>
    <tr>
      <th><strong>名前</strong></th>
      <th><strong>URL</strong></th>
      <th><strong>必要なスコープ</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>List sessions details of a user（ユーザーセッションの詳細を一覧表示する）</td>
      <td>`GET /api/v2/users/{userId}/sessions`</td>
      <td>`read:sessions`</td>
    </tr>

    <tr>
      <td>Delete all user sessions（ユーザーのすべてのセッションを削除する）</td>
      <td>`DELETE /api/v2/users/{userId}/sessions`</td>
      <td>`delete:sessions`</td>
    </tr>
  </tbody>
</table>

<div id="session-properties">
  ## セッションプロパティ
</div>

セッションエンドポイントは、セッションとその履歴に関する関連情報を返します。

<table class="table">
  <thead>
    <tr>
      <th><strong>フィード</strong></th>
      <th><strong>説明</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Session ID（セッションID）</td>
      <td>セッションIDは、Auth0テナントにおける永続的な識別子です。<br /><br />セッションIDはIDトークンやログアウトトークンにある`sid`クレームに対応しているため、それらを相互参照するのに使うことができます。</td>
    </tr>

    <tr>
      <td>Relevant Time（関連時間）</td>
      <td>セッションの作成や認証が行われた日時、および有効期限です。</td>
    </tr>

    <tr>
      <td>Device Information（デバイス情報）</td>
      <td>デバイスプロパティには、このAuth0セッションとのやり取りで使用されたユーザエージェント（ブラウザーなど）の詳細が含まれています。</td>
    </tr>

    <tr>
      <td>認証情報</td>
      <td>このセッションで認証に使用された方法についての要約が含まれています。</td>
    </tr>
  </tbody>
</table>

これらのフィールドの詳細については、[Management APIのドキュメント](/docs/ja-JP/ja-jp/api/management/v2)を参照してください。

<div id="oidc-back-channel-logout-initiators">
  ## OIDCバックチャネルログアウトのイニシエーター
</div>

セッション削除イベントは、`session-deleted`イニシエーターを通して[OIDCバックチャネルログアウト](/docs/ja-JP/ja-jp/authenticate/login/logout/back-channel-logout)に接続されます。詳細については、「[OIDCバックチャネルログアウトのイニシエーター](/docs/ja-JP/ja-jp/authenticate/login/logout/back-channel-logout/oidc-back-channel-logout-initiators)」をお読みください。

<div id="sessions-and-refresh-tokens">
  ## セッションとリフレッシュトークン
</div>

セッションとリフレッシュトークンは、スムーズなユーザー認証とセキュリティを最適化するために連携しします。詳細については、Auth0ブログの「[アプリケーションセッション管理のベストプラクティス](https://auth0.com/blog/application-session-management-best-practices)」をお読みください。

リフレッシュトークンは、セッションが失効や削除された後、またはユーザーがログアウトした後もアクティブなままになります。<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-0" href="/docs/ja-JP/ja-jp/glossary?term=management-api" tip="Management API: 顧客が管理タスクを実行できるようにするための製品。" cta="用語集の表示">Management API</Tooltip>を使用すると、独立して[リフレッシュトークンを管理](/docs/ja-JP/ja-jp/secure/tokens/manage-refresh-tokens-with-auth0-management-api)したり、セッションと連携して管理したりできます。

<div id="limitations">
  ## 制限事項
</div>

セッション削除の操作は非同期で実行され、最終的には整合性が保たれます。

<div id="learn-more">
  ## もっと詳しく
</div>

* [OIDCエンドポイントを使用してユーザーをAuth0からログアウトさせる](/docs/ja-JP/ja-jp/authenticate/login/logout/log-users-out-of-auth0)
* [OIDCバックチャネルログアウト](/docs/ja-JP/ja-jp/authenticate/login/logout/back-channel-logout)
* [OIDCバックチャネルログアウトイニシエータ](/docs/ja-JP/ja-jp/authenticate/login/logout/back-channel-logout/oidc-back-channel-logout-initiators)
* [OIDCバックチャネルログアウトを構成する](/docs/ja-JP/ja-jp/authenticate/login/logout/back-channel-logout/configure-back-channel-logout)
