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

# 認証済みアクセス

公開コンテンツに対するカスタム認証を設定します

認証付きアクセスを使用すると、コンテンツを公開しつつ、閲覧したい訪問者に認証を求めることができます。有効にすると、GitBook はコンテンツへのアクセス権をどの訪問者に付与するかを認証プロバイダーに任せます。

<figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-63ef53d9554190f9c6d459545cb3cd11acc8b31e%2F26_01_06_authenticated_access%402x.png?alt=media" alt="A screenshot showing a login screen for docs behind authenticated access"><figcaption><p>公開済みのドキュメントにサインインを追加します。</p></figcaption></figure>

### ユースケース

認証付きアクセスの一般的なユースケースは次のとおりです。

* 有料顧客、見込み顧客、またはパートナーだけがアクセスできるべき機密性の高い製品ドキュメントを公開しています。
* 自社の従業員のみがアクセスできる社内ナレッジベースのコンテンツを公開する。

### 仕組み

認証付きアクセスを設定する際に選べる方法は 2 つあります。

1. 認証統合のいずれかをインストールします。Okta、Azure、Auth0をサポートしています。 **強くおすすめします** サポート対象の認証プロバイダーを使用している場合は、このオプションをおすすめします。
2. 認証を処理するための独自サーバーを作成してホスティングする方法です。さまざまな技術を利用できますが、選んだソリューションの実装と保守はあなた次第です。

### 組み込みのログイン URL とログアウト URL

GitBook では、公開サイトでのサインインとサインアウト用の組み込み URL が提供されます。

* `<publishedSiteURL>/~gitbook/auth/login`
* `<publishedSiteURL>/~gitbook/auth/logout`

ログイン URL は、サイトのヘッダーリンクなど、サインインリンクを表示したい場所で使用できます。

訪問者がログイン URL を開くと、GitBook はそのサイトに設定された認証バックエンドへリダイレクトします。これは連携バックエンドでもカスタムバックエンドでも機能します。

GitBook は、 `location` というクエリパラメータも追加します。このパラメータは、訪問者が最初にアクセスしたページに対応します。バックエンドでは、この値を使用して、サインイン後に訪問者を同じページに戻すことができます。

ログアウト URL を使用して、訪問者の GitBook セッションからサインアウトさせます。

サイトのアクセス保護の設定を開始するには、「 [認証アクセスの有効化](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access/enabling-authenticated-access.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.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.
