--- title: "Connect the Microsoft Graph API to Tulip with Oauth2" slug: "connect-the-microsoft-graph-api-to-tulip-with-oauth2" updated: 2025-01-13T14:50:42Z published: 2025-01-13T14:50:42Z canonical: "support.tulip.co/connect-the-microsoft-graph-api-to-tulip-with-oauth2" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # 使用 Oauth2 将 Microsoft Graph API 连接到 Tulip *Microsoft Graph API 允许用户与 Teams、Outlook 和 Office Suite 等 Microsoft 应用程序连接。* ## 目的 使用本文档将 Tulip 应用程序与 Teams、Office 套件和 Outlook 等 Microsoft 365 产品集成。 ## 首次设置 ### 概述 必须完成以下步骤才能生成使用 MS Graph API 的正确验证信息: Important Note: Some of these steps require advanced permissions in Microsoft Azure. Be sure the user has sufficient permissions to **Register & Manage an Entra ID Application** before continuing! 1. 在 Microsoft Azure 中注册一个新应用程序。 2. 为应用程序创建新的客户机密文并声明权限。 3. 将客户端秘密和相关身份验证信息复制到 Tulip Oauth2 Connector Configuration。 ### 详细内容:首次设置 #### 1.在 Microsoft Azure 中注册新应用程序 1. 在 Web 浏览器中导航到**portal.azure.com**。 2. 使用组织的凭据登录。 3. 选择**Microsoft Entra ID**。 1. *注:以前称为 Azure Active Directory,可能需要选择 "更多服务 "才能找到此选项。* 4. 在页面左侧的菜单中选择**应用程序注册**。 5. 选择 "**新注册 "**并输入名称。 6. 在**重定向 URI** 下,确保选择 Web,并输入以下 URL`:https://<你的郁金香实例>/oauth-redirect-handler(`*例如,sample.tulip.co* `的`*重定向 URI 为* *`https://sample.tulip.co/oauth-redirect-handler)。`* 7. 选择 "**注册 "**创建 Azure 应用程序。 #### 2.记录所需信息 注册应用程序后,您将被转到新 Azure 应用程序的配置页面。将以下信息复制到记事本或文本文件中,以便以后使用:1.从左侧菜单中选择 "**概述"**,然后记录:1.**应用程序(客户端)ID**;2.**目录(租户)ID**。2. 从左侧菜单中选择**API 权限**。3.3. 选择**应用程序权限**。4.4. 选择**Microsoft Graph**,查看 Tulip 在 Graph API 上可能拥有的所有权限。5. 选择您希望 Tulip Connector 拥有的任何权限。完整的权限列表请[点击此处](https://learn.microsoft.com/en-us/graph/permissions-reference)`{` [target=_blank}](https://learn.microsoft.com/en-us/graph/permissions-reference)。 1.*注 1:建议使用 ctrl/cmd + f 搜索希望使用的 Microsoft 应用程序。例如,搜索 "Teams "以查找与频道和聊天相关的权限。* 2.*注 2:如果使用本指南集成 Tulip Library Connector,可在相关的 Tulip 知识库文章中找到 Connector 运行所需的权限列表*。 6. 记录所选所有权限的**API/Permissions 名称**,如`Files.Read.All`或`User.` `Read`。 #### 3.生成身份验证信息 1. 从应用程序 Azure 配置页面左侧的 "**管理 "**菜单中选择 "**证书和机密"**。 2. 选择**客户端秘密 (0)**。 3. 选择 "**新客户端秘密**"并为新秘密命名。 4. 复制显示的**值**。 #### 4.向郁金香连接器添加身份验证信息 导航到希望与 MS Graph API 一起使用的 Tulip Connector 的配置设置。这可以通过点击连接器主页面上标有**OFFLINE - production & testing & develompent**的方框来完成。 1. 选择**编辑标题。** 2. 在**"身份验证 "**下,选择 1. **Oauth2(操作员)**,如果应用程序用户在运行集成的 Tulip 应用程序时必须登录 MS 365。 2. 如果 Tulip 只在设置或更改此配置时验证 MS 365,并将此登录信息用于 Tulip 实例上的所有应用程序,则选择**Oauth2(服务账户)**。 3. 为其余选项输入之前记录的以下信息: 1. **授权码 URL** `:`*https://login.microsoftonline.com/the 步骤 2.1.b/oauth2/v2*`.0/authorize`*中的目录(租户)ID* 2. **访问令牌 URL** `:`*https://login.microsoftonline.com/the 步骤 2.1.b/oauth2/v2*`.0/token`*中的目录(租户)ID* 3. **客户端 ID**:*步骤 2.1.a 中的应用程序(客户端)ID* 4. **客户端密文**:*步骤 3.4 中的值* 5. **范围**:*在步骤 2.6 中添加的以逗号分隔的权限名称列表,如`Files.Read.All,User.Read。`* 4. 选择 "**测试 "**测试身份验证方法。 5. 选择 "**返回**"返回 "连接器配置"。 6. 最后,在 "**输入连接详细信息**"屏幕上输入以下信息: 1. **运行于**:除非另有说明,否则请选择*云连接器主机*。 2. **主机**:*graph.microsoft.com* 3. **端口**:443(或留空)TLS 4. **TLS**: 是 7. 选择**测试**,配置完成! #### 5.示例 观看下面的视频,了解上述书面内容的示例。为 excel 设置连接器的视频: [Embedded content](https://www.youtube.com/embed/jH2YIfCw4Ss)