> 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).

# Auth0 の設定

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

{% hint style="info" %}
ガイドを見て、 [詳細な手順](https://gitbook.com/docs/guides/docs-personalization-and-authentication/how-to-personalize-your-gitbook-site-using-auth0-and-adaptive-content) Auth0 を使用した認証付きアクセスとアダプティブ コンテンツの設定について。
{% endhint %}

{% hint style="warning" %}
このガイドでは、ドキュメント用の保護されたサインイン画面の設定方法を説明します。このガイドに進む前に、まず次の手順を完了していることを確認してください [認証済みアクセスを有効にする](/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. に移動します **アプリケーション > アプリケーション** を左サイドバーから開きます。
3. 次をクリックします **+ アプリケーションを作成** ボタンをクリックし、アプリに名前を付けます。
4. の下の **アプリケーションの種類を選択し、** 選択して **Regular Web Applications**.
5. 次の場所で **クイックスタート** 新しく作成したアプリの画面で、 **Node.js（Express）** を選び、次に **自分のアプリを統合したい**.
6. その後、下のような設定画面が表示されます。\
   &#x20;**設定を保存して続行**.<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FHoIpHTIRmkCvhw1kBVZZ%2Fauth0_app_configure_screen.png?alt=media&amp;token=ef189183-2547-4e5e-b22f-2d3169f2b600" alt=""><figcaption></figcaption></figure>
7. 次をクリックします **設定** タブから選択することで、セクション内のどこでも参照できます。
8. コピーして以下を控えてください **ドメイン**, **クライアント ID** 、 **クライアント シークレット**.

{% hint style="warning" %}
次の点を確認してください： **少なくとも 1 つの接続が有効になっていること** Auth0 アプリケーションの **接続** タブから選択することで、セクション内のどこでも参照できます。
{% 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%2FgBMsbydNsuqx7eqcz0JN%2Fva_site_integration_overview_screen.png?alt=media&amp;token=ead70cf3-93cf-4aef-b77a-321afad38900" 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%2F98d9Svq3PBdpaiRuyV14%2Fauth0_install_integration.png?alt=media&amp;token=155beba6-bc85-42c6-acb8-18f782f207a4" 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%2FGpdmoJqOQvrwFBaQ17Gv%2Fauth0_configure_integration.png?alt=media&amp;token=61bc203c-2553-453f-b701-176264af044b" alt=""><figcaption></figcaption></figure>
7. 次を入力します **ドメイン**, **クライアント ID** 、 **クライアント シークレット** 先ほど Auth0 アプリケーションを作成した際にコピーした値。Auth0 Domain には、Auth0 からコピーした Domain を入力します（先頭に `https://`).
8. **（任意）** 次の項目を有効にします： **JWT トークンにクレームを含める** サイトで次を有効にしている場合は、ダイアログ下部のオプションを [アダプティブコンテンツ](/docs/documentation/ja-gitbook-documentation/publish/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. 次へ移動します **対象** をクリックして、次を選択します **認証アクセス** （まだ選択されていない場合）。
19. を選択します **Auth0** のドロップダウンから **認証バックエンド** セクションを選択します。
20. クリックして **対象を更新**.
21. サイトの概要画面に移動し、次をクリックします **公開** まだ公開されていない場合。

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

動作を確認するには、次をクリックします： **訪れて**。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/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.
