> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access/setting-up-auth0.md). Agents can also search and read this documentation through its [MCP server](https://gitbook.com/docs/~gitbook/mcp).

# Auth0 の設定

ドキュメント閲覧者向けに Auth0 のログイン画面を設定します

{% hint style="info" %}
ガイドで、Auth0 を使った [設定手順の詳しい解説](https://gitbook.com/docs/guides/docs-personalization-and-authentication/how-to-personalize-your-gitbook-site-using-auth0-and-adaptive-content) を確認し、認証付きアクセスと適応型コンテンツを設定しましょう。
{% endhint %}

{% hint style="warning" %}
このガイドでは、ドキュメントに保護されたサインイン画面を設定する方法を説明します。このガイドに進む前に、まず次のガイドを完了してください。 [認証済みアクセスを有効にする](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access/enabling-authenticated-access.md).
{% endhint %}

Auth0 を使用して認証済みアクセスで GitBook サイトを設定する手順は次のとおりです。

{% stepper %}
{% step %}
[**Auth0 で新しいアプリケーションを作成する**](#id-1.-create-a-new-application-in-auth0)

Auth0 ダッシュボードで Auth0 アプリケーションを作成します。
{% endstep %}

{% step %}
[**Auth0 統合をインストールして設定する**](#id-2.-install-and-configure-the-auth0-integration)

Auth0 統合をインストールし、必要な設定を GitBook サイトに追加します。
{% endstep %}

{% step %}
[**アダプティブコンテンツ用に Auth0 を設定する（任意）**](#id-3.-configure-auth0-for-adaptive-content-optional)

GitBook のアダプティブコンテンツで動作するように Auth0 を設定します。
{% endstep %}
{% endstepper %}

### 1. Auth0 で新しいアプリケーションを作成する

まず、Auth0 プラットフォームのダッシュボードで新しいアプリケーションを作成します。このアプリケーションにより、GitBook Auth0 統合は、サイトへのアクセスを許可する前にユーザーの身元を検証するためのトークンを要求できるようになります。

1. Auth0 の [ダッシュボード](https://manage.auth0.com/dashboard/).
2. 左側のサイドバーから **Applications > Applications** セクションに移動します。
3. 「 **+ Create Application** 」ボタンをクリックし、アプリに名前を付けます。
4. 「 **Choose an application type,** で **Regular Web Applications**.
5. 新しく作成したアプリの **クイックスタート** 画面で、 **Node.js (Express)** を選択し、次に **アプリを連携したい**.
6. をクリックします。次のような設定画面が表示されます。\
   「 **Save Settings And Continue**.<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-6336dc0efba29ee09e37090f092e79c861cd8dd9%2F25_06_30_auth0_app_configure_screen.png?alt=media" alt=""><figcaption></figcaption></figure>
7. 」をクリックします。 **「Settings** 」タブをクリックします。
8. 以下の値をコピーして控えておきます。 **Domain**, **Client ID** および **Client Secret**.

{% hint style="warning" %}
Auth0 アプリケーションで、 **少なくとも1つの接続が有効になっている** ことを確認してください。確認するには、 **Connections** タブを開きます。
{% endhint %}

### 2. Auth0 統合をインストールして設定する

Auth0 アプリケーションを作成したら、次の手順として GitBook に Auth0 統合をインストールし、先ほど生成した資格情報を使用して Auth0 アプリケーションにリンクします。

1. 認証済みアクセスを有効にし、ID プロバイダーとして Auth0 を使用したいサイトに移動します。
2. サイトの設定画面の右上にある **「インテグレーション」** ボタンをクリックします。<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-36cf49e13fdd37a9c62aedf792e698c2451e34ba%2F25_04_10_va_site_integration_overview_screen.png?alt=media" alt=""><figcaption></figcaption></figure>
3. サイドバーのカテゴリから「 **認証済みアクセス** 」をクリックします。
4. 「 **Auth0** 」統合を選択します。
5. クリック **このサイトにインストール**.<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-26f94ea88060f23977db666a955318e1fd6d3b75%2F25_06_30_auth0_install_integration.png?alt=media" alt=""><figcaption></figcaption></figure>
6. サイトに統合をインストールすると、統合の構成画面が表示されます:<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-ca45a2ac3036a0e00a2a9483a8671ce72b403758%2F25_06_30_auth0_configure_integration.png?alt=media" alt=""><figcaption></figcaption></figure>
7. 先ほど作成した Auth0 アプリケーションからコピーした **Domain**, **Client ID** および **Client Secret** の値を入力します。Auth0 Domain には、Auth0 からコピーした Domain を入力します（先頭に `https://`).
8. **を付けてください。（任意）** 有効にします **JWTトークンにクレームを含める** サイトで [アダプティブコンテンツ](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/adaptive-content/enabling-adaptive-content.md).
9. ダイアログの下部に表示される **コールバック** **URL** をコピーして控えておきます。 **ダイアログの下部に表示されます**.
10. を選択します。 **保存**.
11. を有効にしている場合は、ダイアログの下部にあるオプションを使用します。
12. サイドバーの **Applications > Applications** に移動し、 **Settings** タブを選択します。
13. 下にスクロールして、設定の **Application URIs** セクションに移動します。
14. 先ほどGitBookのインテグレーションダイアログからコピーした **コールバックURL** を、 **Allowed Callback URL** 入力欄に貼り付けます。
15. を選択します。 **保存します。**
16. GitBookの **Auth0インテグレーション** インストール画面に戻ります **。**.
17. 統合のダイアログを閉じ、サイト画面の **「設定」** タブをクリックします。
18. 「 **対象ユーザー** に移動し、 **「認証済みアクセス」** （まだ選択されていない場合）を選択します。
19. ドロップダウンから **Auth0** を選択します。これは **Authentication backend** セクションにあります。
20. 「 **Update audience**.
21. 」をクリックします。 **サイトの概要画面に移動し、「公開」をクリックします。** サイトがまだ公開されていない場合。

これで、サイトは Auth0 を ID プロバイダーとして使用した認証済みアクセスの背後で公開されています。

動作を確認するには、 **Visit**をクリックします。Auth0でのサインインを求められます。これにより、Auth0を使った認証済みアクセスでサイトが公開されていることを確認できます。

### 3. アダプティブコンテンツ用に Auth0 を設定する（任意）

{% embed url="<https://www.youtube.com/embed/uhWeQkgyg8Y?si=7_kD3RF-Is_MnYhZ>" %}

認証済みアクセスのサイトでアダプティブコンテンツ機能を活用するには、 [Auth0アプリケーションを設定して](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims) 認証トークンにクレームとしてユーザー情報を追加します。

キーと値のペアで表されるこれらのクレームはGitBookに渡され、次の用途に使用できます。 [コンテンツを動的に調整](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/adaptive-content/adapting-your-content.md) して、サイト訪問者に表示できます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access/setting-up-auth0.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
