> 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-azure-ad.md).

# Azure AD の設定

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

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

{% hint style="info" %}
Azure統合には既知の制限があり、見出しのURLフラグメントは認証時に削除されます。ユーザーは正しいページには移動しますが、URL内の見出しではなくページの先頭に移動します。ユーザーが一度認証されると、この動作はセッション中は発生せず、ユーザーは正しい見出しに誘導されます。

これは Microsoft によって導入されたセキュリティ対策によるものです。
{% endhint %}

### 概要

Azure AD を使用した認証アクセスで GitBook サイトをセットアップする手順は次のとおりです:

{% stepper %}
{% step %}
[**Azure AD でアプリ登録を作成する**](#id-1.-create-an-app-registration-in-azure-a-d)

Microsoft Entra ID の管理ダッシュボードで Azure AD アプリ登録を作成します。
{% endstep %}

{% step %}
[**サイトに Azure AD 統合をインストールして構成する**](#id-2.-install-and-configure-the-azure-a-d-integration)

Azure AD 統合をインストールし、必要な構成を GitBook サイトに追加します。
{% endstep %}

{% step %}
[**アダプティブコンテンツ用に Azure AD を構成する（オプション）**](#id-3.-configure-azure-a-d-for-adaptive-content-optional)

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

### 1. Azure AD でアプリ登録を作成する

まず Microsoft Entra ID ダッシュボードでアプリ登録を作成します。このアプリ登録により、GitBook の Azure AD 統合は、サイトへのアクセスを許可する前にユーザーのIDを検証するためのトークンを要求できるようになります。

1. Microsoft Entra ID 管理者にサインインする [ダッシュボード](https://entra.microsoft.com/).
2. に移動します **ID** > **アプリケーション** > **アプリ登録** 左側のサイドバーから。
3. をクリックします **+ 新規登録、** そして登録に名前を付けます。
4. 次の項目の下で **対応するアカウントの種類、** 「**この組織ディレクトリ内のアカウントのみ（既定のディレクトリのみ - シングルテナント）**.
5. Redirect URI フィールドは今は空のままにしておいてください。後で入力する必要があります。
6. クリックして **登録** してアプリ登録を完了します。<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FuB6p6HxRmveHp1cfsiKa%2Fazure_ad_integration_register_app.png?alt=media&amp;token=cbc82bc5-189e-433a-b990-042066768307" alt="An Azure screenshot showing how to register an Azure AD app"><figcaption><p>GitBook VA 統合用のアプリを登録します。</p></figcaption></figure>
7. その後、新しいアプリ登録の **概要** 画面が表示されます。以下をコピーして控えてください。 **アプリケーション（クライアント）ID** 、 **ディレクトリ（テナント）ID**.<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FETQziXVuqGnho8GGOVBZ%2Fazure_ad_integration_app_reg_overview.png?alt=media&amp;token=266a55e3-db75-4a4a-923c-8302f69653d5" alt="An Azure screenshot showing the app registration overview"><figcaption><p>新しく作成したアプリ登録の概要。</p></figcaption></figure>
8. をクリックします **証明書またはシークレットを追加する**。次の **証明書とシークレット** 画面が表示されます:<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FnXJbnpnGhOI6Udjrx8bS%2Fazure_ad_integration_client_secrets.png?alt=media&amp;token=9202689b-4657-4bea-bf74-42b51e1051e5" alt="An Azure screenshot showing where to add a certificate or secret"><figcaption><p>証明書またはシークレットを追加します。</p></figcaption></figure>
9. をクリックします **+ 新しいクライアント シークレット**.
10. シークレットに適切な説明を入力し、次をクリックします **追加する**.
11. コピーして以下を控えてください **値** フィールド（***しません** シークレット ID*）今作成したシークレットのもの。

### 2. Azure AD 統合をインストールして構成する

Azure AD アプリ登録を作成したら、次の手順は GitBook に Azure AD 統合をインストールし、先ほど生成した資格情報を使用して Azure アプリケーションにリンクすることです:

1. 以下のサイトに移動します [認証アクセスを有効にしている](/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access/enabling-authenticated-access.md#enable-authenticated-access) そして Azure AD を ID プロバイダーとして使用したいサイト。
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="A GitBook screenshot showing the site settings overview"><figcaption></figcaption></figure>
3. をクリックします **認証済みアクセス** サイドバーのカテゴリから。
4. 次を選択します **Azure** 連携。
5. クリックして **このサイトにインストール**.<br>

   <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FCiveWUn0FWMEdS3YRU62%2FScreenshot%202025-03-24%20at%2018.10.09.png?alt=media&amp;token=fcaedce7-40f5-40e5-acd1-040e90822be4" alt="A GitBook screenshot showing installation of the Azure AD integration"><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%2FvO9pXBCZkcprDDIVFkcf%2FScreenshot%202025-03-24%20at%2018.17.02.png?alt=media&amp;token=e082d3dd-1e6b-44b4-beaf-a5d67812e055" alt="A GitBook screenshot showing the Azure AD configuration dialog"><figcaption></figcaption></figure>
7. 次を入力します **クライアント ID**, **テナント ID**を読み取り、 **クライアント シークレット** 先ほどコピーした値を [Azure AD アプリ登録を作成した](#id-1.-create-an-app-registration-in-azure-a-d) ときのものを入力し、「保存」をクリックします。
8. 次をコピーします **URL** 表示されている **ダイアログの下部にある**.
9. Microsoft Entra ID ダッシュボードで先ほど作成した Azure AD アプリ登録に戻ります。
10. 次へ移動します **管理** > **認証** をサイドバーで。
11. クリックして **+ プラットフォームを追加** をクリックして、次を選択します **Web** 開いたパネルのカード。<br>

    <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FUssw9BNY66urLYH376sE%2FScreenshot%202025-03-24%20at%2018.28.58.png?alt=media&amp;token=2c2b2b84-b7e9-4fc3-a7bd-2751dacfd579" alt="An Azure screenshot showing authentication platform settings"><figcaption></figcaption></figure>
12. 先ほどコピーした GitBook 統合の **URL** を、以下の **Redirect URI** フィールドに貼り付け、「構成」を<br>

    <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fi9fVjsa351I6kVzJw64X%2Fimage.png?alt=media&amp;token=85d1d25a-bdb8-4453-b30e-54a21304f870" alt="An Azure screenshot showing where to enter the redirect URI"><figcaption></figcaption></figure>
13. 次に戻ります **Azure 統合** インストール画面 **GitBook の**.
14. 統合ダイアログを閉じ、次をクリックします **設定** サイドバーのタブ。
15. 次へ移動します **対象** をクリックして、次を選択します **認証アクセス** （まだ選択されていない場合）。
16. を選択します **Azure** のドロップダウンから **認証バックエンド** セクションを選択します。
17. クリックして **対象を更新**.<br>

    <figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Finc5DrItbyXUIXP4K4ic%2FScreenshot%202025-03-24%20at%2018.41.45.png?alt=media&amp;token=e06283f6-f7d6-4556-9ef7-747b47493064" alt="A GitBook screenshot showing authenticated access settings"><figcaption></figcaption></figure>
18. サイトの概要画面に移動し、次をクリックします **公開** まだ公開されていない場合。

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

動作を確認するには、「訪問」をクリックします。Azure でサインインするよう求められます。これにより、サイトが Azure を使用した認証アクセスの背後で公開されていることが確認できます。

{% hint style="info" %}
公開されたコンテンツの URL にアクセスし、Azure の認証情報でログインすると、管理者に「承認を依頼する」必要があることを示す画面が表示される場合があります。管理者は公開されたコンテンツの URL にアクセスしてログインし、組織を代表して承認を与えることでこの要求を承認できます。
{% endhint %}

### 3. アダプティブコンテンツ用に Azure AD を構成する（オプション）

認証アクセスサイトでアダプティブコンテンツ機能を活用するには、認証トークンに追加のユーザー情報をクレームとして含めるよう Azure AD アプリ登録を構成します。

これらのクレームはキーとバリューのペアとして表され、GitBook に渡されて、次の用途に使用できます [コンテンツを適応させる](/docs/documentation/ja-gitbook-documentation/publish/adaptive-content/adapting-your-content.md) ために使われます。

Azure AD はさまざまな種類とレベルのクレームをサポートしており、それぞれ設定方法が異なります:

* **標準クレーム**：トークンに含められることがある一般的なクレームですが、既定では常に存在するとは限りません。

{% hint style="info" %}
Azure AD はパフォーマンスのためにトークンサイズを最適化しています。その結果、多くのクレームは **しません** 既定ではトークンに含まれておらず、アプリケーションから明示的に要求する必要があります。次のようなクレームを確実に含めるには `email` , `groups` または `roles` 含めるには、これらを明示的に **オプショナル クレーム**.
{% endhint %}

* **オプショナル クレーム**：アプリケーションで有効にできる追加の事前定義クレーム。
* **カスタム クレーム**：Azure AD のカスタム ユーザー属性またはカスタム クレーム プロバイダーを介した外部システムから取得されるクレーム。

Azure AD アプリによって生成されるトークンにこれらのさまざまな種類のクレームを含める方法の詳細については、次の Microsoft Entra のドキュメント ガイドを参照してください:

* [ユーザー属性](https://learn.microsoft.com/en-us/entra/external-id/customers/how-to-add-attributes-to-token)
* [オプショナル クレーム](https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims?toc=%2Fentra%2Fexternal-id%2Ftoc.json\&bc=%2Fentra%2Fexternal-id%2Fbreadcrumb%2Ftoc.json\&tabs=appui)
* [カスタム クレーム](https://learn.microsoft.com/en-us/entra/identity-platform/custom-claims-provider-overview)

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-azure-ad.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.
