> 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——微软的云身份平台，前称 Azure AD——连接为贵组织的身份提供商。连接后，您的用户将通过单点登录使用其 Microsoft 凭据登录 Dispel。您可以通过 **OAuth（OIDC）** 或 **SAML**.

本页介绍 Entra 特有的设置。有关适用于所有提供商的通用行为——用户如何登录、组映射、MFA，以及断开连接——请参见 [身份提供商](/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md).

{% hint style="info" %}
**在哪里找到它。** 以组织管理员身份登录并打开 **设置 → 集成** （或专门的 **设置 → 身份验证** 页面）。Microsoft Entra ID 会显示在 **身份与身份验证（IdP / SSO）** 部分。点击 **连接** 卡片上的它开始。
{% endhint %}

## 开始之前

* 您将在……中配置 IdP 侧 **Microsoft Entra 管理中心** （或 Azure 门户），因此您需要在那里拥有管理员访问权限。
* 选择一种协议—— **OAuth（OIDC）** 或 **SAML**。请参阅 [选择协议](/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. 添加一个 **Web** 重定向 URI，为您的 Dispel 地址后接 `/oauth/login-callback` ——例如 `https://app.dispel.com/oauth/login-callback`。如果不确定，请向您的 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 进行身份验证。请参见 [用户如何登录](/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#how-users-sign-in).
* **将 Entra 组映射到 Dispel 组** 以保持成员资格同步——请参阅 [OIDC 组映射](/documentation/documentation-zh/ji-cheng-yu-guan-li/integrations/oidc-group-mapping.md).
* **MFA** 在 Entra 中强制实施的设置会在登录时生效；Dispel 的电子邮件一次性验证码不适用于 SSO 用户。请参见 [SSO 和多因素身份验证](/documentation/documentation-zh/bao-hu-yu-zhi-li/identity-providers.md#sso-and-multi-factor-authentication).
* **要切换协议或提供商**，请先断开连接。请参阅 [切换或断开提供商连接](/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.
