> For the complete documentation index, see [llms.txt](https://docs.dispel.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers/microsoft-entra-id.md).

# Microsoft Entra ID

使用 Microsoft Entra ID（原 Azure AD）作为你的身份提供方，使用户通过 OAuth（OIDC）或 SAML 使用其 Microsoft 凭据登录 Dispel。

## 概述

将 Microsoft Entra ID（Microsoft 的云身份平台，前身为 Azure AD）连接为贵组织的身份提供商。连接后，用户即可通过单点登录，使用 Microsoft 凭据登录 Dispel。您可以通过 **OAuth (OIDC)** 或 **SAML**.

接入 Entra。本页介绍 Entra 特有的设置。有关适用于所有提供商的通用行为（包括用户登录方式、组映射、多重身份验证和断开连接），请参阅 [身份提供商](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md).

{% hint style="info" %}
**查找位置。** 以组织管理员身份登录，然后打开 **设置 → 集成** （或专用的 **设置 → 身份验证** 页面）。Microsoft Entra ID 位于 **身份与身份验证 (IdP / SSO)** 部分。点击其卡片上的 **连接** 即可开始。
{% endhint %}

## 开始之前

* 您需要在 **Microsoft Entra 管理中心** （或 Azure 门户）配置 IdP，因此需要相应的管理员访问权限。
* 选择一种协议： **OAuth (OIDC)** 或 **SAML**。请参阅 [选择协议](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#choosing-a-protocol).
* 确保将通过 Entra 登录的用户已 **受邀加入您的组织** 并已加入 Dispel。SSO 会验证用户身份，但不会自动授予访问权限。

{% hint style="warning" %}
**一次只能连接一个提供商。** 如果您的组织已连接到其他身份提供商，请先断开连接，再连接 Entra。
{% endhint %}

## 通过 OAuth (OIDC) 连接

#### 在 Microsoft Entra ID 中

1. 在 Microsoft Entra 管理中心，转到 **应用注册 → 新注册** ，为 Dispel 创建应用。
2. 添加以下 2 个 **Web** 重定向 URI，供您的 Dispel 环境使用：
   * `/oauth/login-callback` —（例如`https://app.dispel.com/oauth/login-callback`).
   * `/client-app-launcher/oktaauth.dispel.io` —（例如 `https://app.dispel.com/client-app-launcher/oktaauth.dispel.io`).
   * 如果不确定，请向 Dispel 代表确认您所在环境的准确地址。
3. 在 **证书和机密**下，创建一个 **客户端机密** 并复制其值。
4. 记下您的 **应用程序（客户端）ID** 以及租户的 OAuth/OIDC 端点。

#### 在 Dispel 中

1. 点击 **连接** Microsoft Entra ID 卡片上的按钮，然后 **选择身份验证协议 → OAuth**.
2. 填写以下字段：

| 字段          | 来自 Entra 的值                  |
| ----------- | ---------------------------- |
| **客户端 URL** | 租户的 OAuth/OIDC 端点（颁发令牌的位置）。  |
| **客户端 ID**  | 你的 **应用程序（客户端）ID** （来自应用注册）。 |
| **客户端密钥**   | 你创建的客户端密码值。                  |
| **组织标识符**   | 您自行选择的唯一标识符；用户在登录屏幕上输入该标识符。  |

3. 点击 **保存设置**.

## 使用 SAML 连接

#### 在 Microsoft Entra ID 中

1. 在 Microsoft Entra 管理中心，转到 **企业应用程序 → 新建应用程序 → 创建自己的应用程序**，然后打开 **单一登录 → SAML**.
2. 在 **基本 SAML 配置**中，粘贴 Dispel 在其 SAML 表单顶部显示的值：
   * **标识符（实体 ID）** ← Dispel 的 **服务提供商 (SP) 实体 ID**.
   * **回复 URL（断言使用者服务 URL）** ← Dispel 的 **断言使用者服务 URL**.
3. 从 Entra SAML 设置中获取：
   * **登录 URL** → Dispel 的 **SSO URL**.
   * **Microsoft Entra 标识符** → Dispel 的 **身份提供商实体 ID**.
   * 下载 **证书（Base64）** → Dispel 的 **Base64 签名证书**.

#### 在 Dispel 中

1. 点击 **连接** Microsoft Entra ID 卡片上的 **选择“身份验证协议”→“SAML”**.
2. 复制表单顶部显示的 **服务提供商 (SP) 实体 ID** 和 **断言使用者服务 URL** （使用 **复制 ID** / **复制 URL**）并按上述说明填入 Entra。
3. 填写以下字段：

| 字段              | 来自 Entra 的值                      |
| --------------- | -------------------------------- |
| **SSO URL**     | Entra **登录 URL**.                |
| **身份提供商实体 ID**  | 该 **Microsoft Entra 标识符**.       |
| **Base64 签名证书** | 下载的 Base64 证书。粘贴证书，或使用 **上传证书**. |
| **组织标识符**       | 您自行选择的唯一标识符；用户在登录屏幕上输入该标识符。      |

4. 点击 **保存设置**.
5. 点击 **测试连接**。Dispel 会将你重定向到 Entra 进行登录，然后显示收到的电子邮件地址和姓名。如果测试失败，请确认这些值与 Entra 应用中的值一致，并且测试用户已受邀加入你的组织。

## 连接后

* **用户登录** 时，在 Dispel 登录页面输入组织标识符，然后使用 Microsoft 进行身份验证。请参阅 [用户如何登录](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#how-users-sign-in).
* **将 Entra 组映射到 Dispel 组** ，使成员资格保持同步——请参阅 [组映射](https://docs.dispel.com/documentation/documentation-zh/ji-cheng-yu-guan-li/integrations/group-mapping.md).
* **在 Entra 中强制执行的** MFA 会在登录时生效；Dispel 的电子邮件一次性验证码不适用于 SSO 用户。请参阅 [SSO 与多重身份验证](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#sso-and-multi-factor-authentication).
* **如需切换协议或提供商**，请先断开连接。请参阅 [切换或断开提供商](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#switching-or-disconnecting-a-provider).

## 常见问题

<details>

<summary>这和“Azure AD”是一样的吗？</summary>

是的。Microsoft 已将 Azure Active Directory 更名为 Microsoft Entra ID。如果你的 Entra 控制台中某些位置仍显示“Azure AD”标签，设置方式仍然相同。

</details>

<details>

<summary>我应该使用哪种协议连接 Entra？</summary>

两种协议都可以。选择与你的 Entra 应用配置相符的方式——OAuth 使用 OIDC 应用注册，SAML 则使用启用了 SAML 单点登录的企业应用。

</details>

<details>

<summary>SAML 连接测试失败了。应该检查哪些内容？</summary>

请确认 SSO URL、实体 ID 和证书与 Entra SAML 应用中的配置完全一致；确认已将 Dispel 的 SP 实体 ID 和 ACS URL 粘贴到 Entra 的“基本 SAML 配置”中；并确认测试用户已在 Entra 中创建，且已受邀加入你的 Dispel 组织。

</details>


---

# 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://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers/microsoft-entra-id.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.
