> For the complete documentation index, see [llms.txt](https://gitbook-open-v2-preview.gitbook.workers.dev/url/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-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/ja-gitbook-documentation/saitohenoakusesu/authenticated-access/setting-up-auth0.md).

# Auth0の設定

{% hint style="info" %}
ガイドを確認して、 [完全な手順](https://gitbook.com/docs/guides/product-guides/how-to-personalize-your-gitbook-site-using-auth0-and-adaptive-content) Auth0 を使って認証済みアクセスとアダプティブコンテンツを設定する方法。
{% endhint %}

{% hint style="warning" %}
このガイドでは、ドキュメント用の保護されたサインイン画面を設定する手順を説明します。このガイドを進める前に、まず次の手順を完了していることを確認してください。 [認証済みアクセスを有効にする](/url/gitbook.com/docs/documentation/ja-gitbook-documentation/saitohenoakusesu/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. 次へ移動します **アプリケーション > アプリケーション** セクションを左サイドバーから開きます。
3. 次をクリックします **+ アプリケーションを作成** ボタンをクリックし、アプリに名前を付けます。
4. の下で **アプリケーションタイプを選択し、** 選択 **Regular Web Applications**.
5. 内で、 **クイックスタート** 新しく作成したアプリの画面で、 **Node.js (Express)** に定義し、さらに **I want to integrated my app**.
6. その後、以下のような設定画面が表示されます。\
   クリックしてください **Save Settings And Continue**.<br>

   <figure><img src="/files/4fc386a2c9162c14da184d97576c25d6477e8b3e" alt=""><figcaption></figcaption></figure>
7. 次をクリックします **設定** タブを選択することで見つけて再度開くことができます。
8. 次の項目をコピーして控えておいてください **Domain**, **Client ID** 、 **Client Secret**.

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

### 2. Auth0 インテグレーションをインストールして設定する

Auth0 アプリケーションを作成したら、次の手順として GitBook に Auth0 インテグレーションをインストールし、先ほど生成した認証情報を使って Auth0 アプリケーションと接続します。

1. 認証済みアクセスを有効にし、ID プロバイダーとして Auth0 を使用したいサイトに移動します。
2. 次をクリックします **Integrations** ボタンをサイト設定の右上にあるものから。<br>

   <figure><img src="/files/72dff4f95ef795a3ff96bfc7ecdce83a720ef3c6" alt=""><figcaption></figcaption></figure>
3. 次をクリックします **認証済みアクセス** サイドバーのカテゴリから。
4. 次を選択します **Auth0** 連携。
5. クリック **このサイトにインストール**.<br>

   <figure><img src="/files/fb217b1ca7514e209b675f04c16a33ca7a73a3ec" alt=""><figcaption></figcaption></figure>
6. サイトに連携をインストールすると、連携の設定画面が表示されるはずです:<br>

   <figure><img src="/files/57d8439892e4e119d3739350a7db6a1e80ad996c" alt=""><figcaption></figcaption></figure>
7. 次を入力します **Domain**, **Client ID** 、 **Client Secret** Auth0 アプリケーションを作成した際にコピーした値。Auth0 Domain には、Auth0 からコピーした Domain を入力します（先頭に `https://`).
8. **（任意）** を付けることを忘れずに **JWT トークンにクレームを含める** オプションをダイアログ下部で有効にしてください。サイトで [アダプティブコンテンツ](/url/gitbook.com/docs/documentation/ja-gitbook-documentation/saitohenoakusesu/adaptive-content/enabling-adaptive-content.md).
9. 次の項目をコピーして控えておいてください **Callback** **URL** 表示されている **ダイアログの下部に**.
10. クリック **保存**.
11. 先ほど Auth0 ダッシュボードで作成した Auth0 アプリケーションに戻ります。
12. 次へ移動します **アプリケーション > アプリケーション** をサイドバーで開き、 **設定** タブを選択することで見つけて再度開くことができます。
13. にスクロールします **Application URIs** 設定のセクション
14. 先ほどコピーした **Callback URL** を GitBook のインテグレーションダイアログから次の場所に貼り付けます。 **Allowed Callback URL** 入力欄。
15. クリック **保存します。**
16. 次に戻ります **Auth0 インテグレーション** インストール画面 **GitBook 内の**.
17. 連携ダイアログを閉じて、次をクリックします **設定** タブをサイト画面で。
18. 次へ移動します **Audience** をクリックし、開いたパネルで **認証付きアクセス** （まだ選択されていない場合）。
19. 選択 **Auth0** ドロップダウンから **Authentication backend** セクションを選択します。
20. クリック **オーディエンスを更新**.
21. サイトの概要画面に移動し、次をクリックします **公開** サイトがまだ公開されていない場合。

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

試すには、 **で定義されたビジュアルスタイルを使用します。訪問する**をクリックしてください。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 に渡され、次の目的に使用できます [コンテンツを動的に適応](/url/gitbook.com/docs/documentation/ja-gitbook-documentation/saitohenoakusesu/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/ja-gitbook-documentation/saitohenoakusesu/authenticated-access/setting-up-auth0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
