> ## 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はリフレッシュトークンを資格情報アーティファクトとして発行し、アプリケーションは、これを使うことでユーザーによる介入なしに新しいアクセストークンを取得することができます。その結果、Auth0はセキュリティの強化を目的にアクセストークンの有効期間を短くでき、アクセストークンの期限が切れてもユーザーの操作を必要としません。

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

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

Auth0 <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>は、リフレッシュトークンを個別またはコレクションとして管理するためのエンドポイントを提供します。

これらのエンドポイントは、`device-credentials`リソースエンドポイントを、拡張されたプロパティと一括取り消し操作に置き換えることで、[代替のリフレッシュトークンの取り消し](/docs/ja-JP/ja-jp/secure/tokens/refresh-tokens/revoke-refresh-tokens)を補完します。

<div id="refresh-token-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>View a refresh token information by ID（リフレッシュトークン情報をIDで表示する）</td>
      <td>`GET /api/v2/refresh-tokens/{tokenId}`</td>
      <td>`read:refresh_tokens`</td>
    </tr>

    <tr>
      <td>Revoke a refresh token by ID（リフレッシュトークンをIDで取り消す）</td>
      <td>`DELETE /api/v2/refresh-tokens/{tokenId}`</td>
      <td>`delete:refresh_tokens`</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>ユーザーのすべてのリフレッシュトークンを一覧表示する</td>
      <td>`GET /api/v2/users/{userId}/refresh-tokens`</td>
      <td>`read:refresh_tokens`</td>
    </tr>

    <tr>
      <td>ユーザーのすべてのリフレッシュトークンを取り消す</td>
      <td>`DELETE /api/v2/users/{userId}/refresh-tokens`</td>
      <td>`delete:refresh_tokens`</td>
    </tr>
  </tbody>
</table>

<div id="refresh-token-properties">
  ## リフレッシュトークンのプロパティ
</div>

リフレッシュトークンのエンドポイントはトークンやその履歴についての関連情報を返します。

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

  <tbody>
    <tr>
      <td>リフレッシュトークンID</td>
      <td>APIのリフレッシュトークンにあるテナント固有の識別子です。トークン自体ではありません。トークンはAuthentication APIのトークンエンドポイントとやり取りされる秘密です。<br /><br />リフレッシュトークンはセッションの生存期間に制約されません。セッションのライフサイクルにかかわらず、リフレッシュトークンはこの情報を保持します。</td>
    </tr>

    <tr>
      <td>セッションID</td>
      <td>セッションIDは、Auth0テナントにおける永続的な識別子です。セッションIDはIDトークンやログアウトトークンにある`sid`クレームに対応しているため、それらを相互参照するのに使うことができます。<br /><br />リフレッシュトークンは、トークンの作成に使用されたセッションを参照します。セッションIDを使用すると、Management APIの<a href="https://auth0.com/docs/ja-jp/manage-users/sessions/manage-user-sessions-with-auth0-management-api">IDで特定セッションのイントロスペクト</a>エンドポイントを使って追加情報を取得することができます。</td>
    </tr>

    <tr>
      <td>関連時間</td>
      <td>リフレッシュトークンが作成された日付や有効期限に関する情報です。</td>
    </tr>

    <tr>
      <td>クライアントとリソースサーバーの情報</td>
      <td>リフレッシュトークンに結び付けられたアプリケーションとAPIの要約です。</td>
    </tr>

    <tr>
      <td>デバイスコンテキスト</td>
      <td>デバイスプロパティには、リフレッシュトークンの作成と交換に使用されたネットワーク（IP、ASN）とユーザエージェントの詳細が含まれています。</td>
    </tr>
  </tbody>
</table>

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

* リフレッシュトークンの取り消し（`DELETE`）操作は非同期で実行され、最終的に一貫性を持ちます。
* 2023年9月21日以降に発行されたリフレッシュトークン（US-3リ－ジョンのテナントの場合は2024年2月22日）には、適切な値を持つセッションID（`session_id`）プロパティが含まれます。この日付よりも前に発行されたリフレッシュトークンには、`null`値を持つこのプロパティが含まれます。

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

* [リフレッシュトークン](/docs/ja-JP/ja-jp/secure/tokens/refresh-tokens)
* [リフレッシュトークンの取り消し](/docs/ja-JP/ja-jp/secure/tokens/refresh-tokens/revoke-refresh-tokens)
* [リフレッシュトークンの使用](/docs/ja-JP/ja-jp/secure/tokens/refresh-tokens/use-refresh-tokens)
