> 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/gong-kai/site-audience/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" %}
このガイドでは、ドキュメント用の保護されたサインイン画面の設定手順を説明します。このガイドを始める前に、まず次の手順を完了していることを確認してください [認証済みアクセスを有効にする](/docs/documentation/ja-gitbook-documentation/gong-kai/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. の **アプリケーションの種類を選択し、** 次を選択します **Regular Web Applications**.
5. で、 **クイックスタート** 新しく作成したアプリの画面で、次を選択します **Node.js (Express)** と定義し、さらに **自分のアプリを統合したい**.
6. すると、以下のような設定画面が表示されます。\
   次をクリックしてください **Save Settings And Continue**.<br>

   <figure><img src="/files/4fc386a2c9162c14da184d97576c25d6477e8b3e" alt=""><figcaption></figcaption></figure>
7. をクリックします **設定** タブ。
8. 次をコピーして控えてください: **ドメイン**, **クライアント ID** 、 **クライアント シークレット**.

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

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

Auth0 アプリケーションを作成したら、次の手順は GitBook に Auth0 統合をインストールし、先ほど生成した認証情報を使って Auth0 アプリケーションとリンクすることです：

1. 認証済みアクセスを有効にし、Auth0 を ID プロバイダーとして使用したいサイトに移動します。
2. をクリックします **統合** ボタンを、サイトの設定の右上にある。<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. 次の値を入力します: **ドメイン**, **クライアント ID** 、 **クライアント シークレット** 先ほど Auth0 アプリケーションを作成した後にコピーした値。Auth0 Domain には、Auth0 からコピーした Domain を入力します（先頭に次を付けることを忘れないでください `https://`).
8. **（オプション）** 次を有効にします： **JWT トークンにクレームを含める** サイトで次を有効にしている場合は、ダイアログ下部のオプションを [アダプティブ コンテンツ](/docs/documentation/ja-gitbook-documentation/gong-kai/adaptive-content/enabling-adaptive-content.md).
9. 次をコピーして控えてください: **Callback** **URL** 表示された **ダイアログの下部に**.
10. クリックして **保存**.
11. Auth0 ダッシュボードで先ほど作成した Auth0 アプリケーションに戻ります。
12. 次へ移動します **Applications > Applications** サイドバーで次を選択し、 **設定** タブ。
13. 次までスクロールします： **Application URIs** 設定のセクション
14. 次を貼り付けます： **Callback URL** 先ほど GitBook 統合ダイアログからコピーしたものを、次の欄に **Allowed Callback URL** 入力フィールド
15. クリックして **保存します。**
16. 次へ戻ります **Auth0 統合** インストール画面に **GitBook で**.
17. 統合ダイアログを閉じ、 **設定** サイト画面のタブをクリックします。
18. 次へ移動します **対象** を選択し、 **認証アクセス** （まだ選択されていない場合）。
19. 選択します **Auth0** のドロップダウンから **認証バックエンド** セクションを選択します。
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 に渡され、 [コンテンツを適応させる](/docs/documentation/ja-gitbook-documentation/gong-kai/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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
