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

# Auth0 ログアウト

> ユーザーをログアウトし、必要に応じてログアウト後に指定したURLにリダイレクトします。

<h2 id="endpoint">
  エンドポイント
</h2>

`GET /v2/logout`

このエンドポイントは、ユーザーをログアウトするために使用します。ログアウト後にユーザーを特定の URL に遷移させたい場合は、その URL を `returnTo` パラメーターに設定します。URL は該当する `Allowed Logout URLs` リストに含まれている必要があります。

* `client_id` パラメーターが含まれている場合、`returnTo` URL はアプリケーション レベルの `Allowed Logout URLs` セットに登録されている必要があります。詳しくは、[Log Users Out of Applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications) を参照してください。
* `client_id` パラメーターが含まれていない場合、`returnTo` URL はテナント レベルの `Allowed Logout URLs` セットに登録されている必要があります。詳しくは、[Log Users Out of Auth0](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0) を参照してください。
* `client_id` パラメーターが含まれていて、`returnTo` URL が設定されていない場合、サーバーは Dashboard で設定されている最初の `Allowed Logout URLs` にユーザーを戻します。詳しくは、[Log Users Out of Applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications) を参照してください。

<h3 id="remarks">
  備考
</h3>

* ユーザーをID プロバイダーからログアウトさせるのは一般的ではないため、`federated` クエリ文字列パラメーターを使用する前に、ユーザー体験への影響をよく検討してください。
* auth0.js スクリプトのサンプルでは、ライブラリのバージョン 8 を使用しています。auth0.js バージョン 7 を使用している場合は、こちらの[リファレンスガイド](https://auth0.com/docs/libraries/auth0js)を参照してください。

<h3 id="learn-more">
  詳細はこちら
</h3>

* [ログアウト](https://auth0.com/docs/authenticate/login/logout)

<h2 id="query-parameters">
  クエリパラメータ
</h2>

<ParamField query="client_id" type="string">
  アプリケーションの `client_id`。
</ParamField>

<ParamField query="returnTo" type="string" required>
  ログアウト後にユーザーをリダイレクトする先の URL。
</ParamField>

<ParamField query="federated" type="string">
  ユーザーを ID プロバイダーからもログアウトさせるには、このクエリ文字列パラメーターをログアウト URL に追加します。
</ParamField>

<h2 id="response-messages">
  レスポンスメッセージ
</h2>

| Status | Description                       |
| ------ | --------------------------------- |
| 200    | ログアウトに成功しました                      |
| 400    | 不正なリクエストです。必須パラメータが不足している可能性があります |
