> ## Documentation Index
> Fetch the complete documentation index at: https://docs.windsurf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 设置 SSO（单点登录）和 SCIM

> 使用 Google Workspace、Microsoft Azure AD、Okta 或其他 SAML 身份提供商，为你的组织配置 SSO（单点登录）和基于 SCIM（跨域身份管理系统，一种用于自动化用户和群组供应的开放标准）的用户预配。

此功能仅对 Teams 和 Enterprise 用户开放。

<Tabs>
  <Tab title="Google SSO（单点登录）">
    Windsurf 现在支持通过 SAML 的 SSO（单点登录）登录。如果你的组织使用 Microsoft Entra、Okta、Google Workspaces 或其他支持 SAML 的身份提供商，你就可以在 Windsurf 中使用 SSO。

    <Note>Windsurf 仅支持由 SP 发起的 SSO；目前不支持由 IDP 发起的 SSO。</Note>

    ### 配置 IDP 应用

    在 Google 管理控制台（admin.google.com）左侧点击 **Apps -> Web and mobile apps**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-google.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=9d300c86c609da6ee3fb630e91f4de3e" width="530" height="788" data-path="assets/auth/sso-google.png" />
    </Frame>

    点击 **Add app**，然后选择 **Add custom SAML app**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-google2.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=44375b535f269f130aea8c5bd6e736be" width="514" height="534" data-path="assets/auth/sso-google2.png" />
    </Frame>

    将 **App name** 填写为 `Windsurf`，并点击 **Next**。

    下一页（Google Identity Provider details）包含需要复制到 [https://windsurf.com/team/settings](https://windsurf.com/team/settings) 上 Windsurf 的 SSO 设置中的信息。

    * 将 Google 控制台页面上的 **SSO URL** 复制到 Windsurf 设置中的 **SSO URL**
    * 将 Google 控制台页面上的 **Entity ID** 复制到 Windsurf 设置中的 **Idp Entity ID**
    * 将 Google 控制台页面上的 **Certificate** 复制到 Windsurf 设置中的 **X509 Certificate**
    * 在 Google 控制台页面点击 **Continue**

    Google 控制台页面的下一页需要你从 Codeium 的设置页面复制信息

    * 将 Codeium 设置页面上的 **Callback URL** 复制到 Google 控制台页面的 **ACS URL**
    * 将 Codeium 设置页面上的 **SP Entity ID** 复制到 Google 控制台页面的 **SP Entity ID**
    * 将 **Name ID** 格式更改为 **EMAIL**
    * 在 Google 控制台页面点击 **Continue**

    Google 控制台页面的下一页需要进行一些配置

    * 点击 **Add Mapping**，选择 **First name**，并将 **App attributes** 设置为 **firstName**
    * 点击 **Add Mapping**，选择 **Last name**，并将 **App attributes** 设置为 **lastName**
    * 点击 **Finish**

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-google3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=c29f0ebf5a05dd5fae3a1127c4111d29" width="2078" height="862" data-path="assets/auth/sso-google3.png" />
    </Frame>

    在 Codeium 的设置页面，点击 **Enable Login with SAML**，然后点击 **Save**。请务必点击 **Test Login** 确认登录正常。现在将对所有用户强制启用 SSO 登录。
  </Tab>

  <Tab title="Microsoft Entra ID">
    Windsurf Enterprise 现已通过 SAML 支持使用 SSO（单点登录）登录。如果你的组织使用 Microsoft Entra ID（原 Azure AD），即可在 Windsurf 中使用 SSO。

    <Note>Windsurf 仅支持由 SP 发起的 SSO；目前不支持由 IdP 发起的 SSO。</Note>

    ## 第 1 部分：在 Microsoft Entra ID 中创建 Enterprise 应用

    <Note>本节所有步骤均在 **Microsoft Entra ID 管理中心** 中完成。</Note>

    1. 在 Microsoft Entra ID 中，点击 **Add**，然后点击 **Enterprise Application**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-azure.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=70c1ef27e1870d1f95176d12cd7c9c47" width="854" height="384" data-path="assets/auth/sso-azure.png" />
    </Frame>

    2. 点击 **Create your own application**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-azure2.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=d8d3d2b159172edef9033487d1167b52" width="680" height="202" data-path="assets/auth/sso-azure2.png" />
    </Frame>

    3. 将应用命名为 **Windsurf**，选择 *Integrate any other application you don't find in the gallery*，然后点击 **Create**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-azure3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=38dd3186171705ca16387dfff4a5b24b" width="968" height="342" data-path="assets/auth/sso-azure3.png" />
    </Frame>

    ## 第 2 部分：在 Microsoft Entra ID 中配置 SAML 和用户属性

    <Note>本节所有步骤均在 **Microsoft Entra ID 管理中心** 中完成。</Note>

    4. 在新的 Windsurf 应用中，点击 **Set up single sign on**，再点击 **SAML**。

    5. 在 **Basic SAML Configuration** 下，点击 **Edit**。

    6. **保持此 Entra ID 标签页打开**，另开新标签页，前往 **Windsurf Teams SSO settings**：[https://windsurf.com/team/settings。](https://windsurf.com/team/settings。)

    7. 在 **Microsoft Entra ID** 的 SAML 配置表单中：
       * **Identifier (Entity ID)**：从 **Windsurf SSO settings page** 复制 **SP Entity ID** 的值
       * **Reply URL (Assertion Consumer Service URL)**：从 **Windsurf SSO settings page** 复制 **Callback URL** 的值
       * 点击顶部的 **Save**

    8. 配置用户属性以正确显示姓名。在 **Microsoft Entra ID** 的 **Attributes & Claims** 中点击 **Edit**。

    9. 点击 **Add new claim** 新建 2 个声明：
       * **第一个声明**：Name = `firstName`，Source attribute = `user.givenname`
       * **第二个声明**：Name = `lastName`，Source attribute = `user.surname`

    ## 第 3 部分：在 Windsurf 门户中配置 SSO 设置

    <Note>在 **Windsurf portal**（[https://windsurf.com/team/settings）中完成配置。](https://windsurf.com/team/settings）中完成配置。)</Note>

    10. 在 **Windsurf SSO settings page** 中：
        * **Pick your SSO ID**：为团队的登录门户选择一个唯一标识符（后续不可更改）
        * **IdP Entity ID**：从 **Microsoft Entra ID** 的 **Set up Windsurf** → **Microsoft Entra Identifier** 复制该值
        * **SSO URL**：从 **Microsoft Entra ID** 复制 **Login URL** 的值
        * **X509 Certificate**：从 **Microsoft Entra ID** 下载 **SAML certificate (Base64)**，打开文件，将文本内容粘贴到此处

    11. 在 **Windsurf portal** 中，点击 **Enable Login with SAML**，然后点击 **Save**。

    12. **测试配置**：点击 **Test Login**，验证 SSO 配置是否按预期工作。

    <Note>**重要**：在成功测试登录之前，请勿登出或关闭 Windsurf 设置页面。如果测试失败，可能需要先排查配置问题再继续。</Note>
  </Tab>

  <Tab title="Okta SSO（单点登录）">
    Windsurf Enterprise 现在通过 SAML 支持使用 SSO（单点登录）登录。如果你的组织使用 Microsoft Entra、Okta、Google Workspaces 或其他支持 SAML 的身份提供商，你可以在 Windsurf 中使用 SSO。

    <Note>Windsurf 仅支持由 SP 发起的 SSO；目前不支持由 IdP 发起的 SSO。</Note>

    ### 配置 IdP 应用

    点击左侧边栏的 Applications，然后选择 Create App Integration

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta1.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=e3f879d2fa7faeba003aa04e2c5d3a4a" width="1248" height="962" data-path="assets/auth/sso-okta1.png" />
    </Frame>

    选择 SAML 2.0 作为登录方式

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta2.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=df39e8a15a879d8f2798a4284087c567" width="1600" height="1023" data-path="assets/auth/sso-okta2.png" />
    </Frame>

    将应用名称设置为 Windsurf（或其他任意名称），然后点击 Next

    按如下方式配置 SAML 设置

    * 将 Single sign-on URL 设为 [https://auth.windsurf.com/\&#95;\&#95;/auth/handler](https://auth.windsurf.com/\&#95;\&#95;/auth/handler)
    * 将 Audience URI (SP Entity ID) 设为 [www.codeium.com](http://www.codeium.com)
    * 将 NameID format 设为 EmailAddress
    * 将 Application username 设为 Email

    按如下方式配置 attribute statements，然后点击 **Next**。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=0903972c21dd13147a1adfe8791f1679" width="1398" height="602" data-path="assets/auth/sso-okta3.png" />
    </Frame>

    在反馈部分，选择“This is an internal app that we have created”，然后点击 **Finish**。

    ### 将 Okta 注册为 SAML 提供商

    你应被重定向到自定义 SAML 应用下的 Sign on 选项卡。现在需要将此页面中的信息填写到 Windsurf 的 SSO 设置中。

    * 打开 [https://windsurf.com/team/settings，并点击](https://windsurf.com/team/settings，并点击) Configure SAML
    * 复制 Okta 应用页面中“Issuer”后的文本，并粘贴到 IdP Entity ID
    * 复制 Okta 应用页面中“Sign on URL”后的文本，并粘贴到 SSO URL
    * 下载 Signing Certificate，并粘贴到 X509 certificate
    * 勾选 Enable Login with SAML，然后点击 Save
    * 使用 Test Login 按钮测试登录。你应会看到成功消息：

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta4.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=574e091c869162bc41dc0aa36cd209fa" width="1046" height="270" data-path="assets/auth/sso-okta4.png" />
    </Frame>

    此时应已全部配置完成，现在可以将用户添加到新的 Windsurf Okta 应用中。

    请将组织的自定义 Login Portal URL 分享给你的用户，并请他们通过该链接登录。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta5.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=f3ccced59b0cbc7d0f0b1b6b39f1ee1c" width="988" height="312" data-path="assets/auth/sso-okta5.png" />
    </Frame>

    通过 SSO 登录 Windsurf 的用户将自动获批加入团队。

    ### 注意事项

    请注意，Windsurf 目前不支持由 IdP 发起的登录流程。

    我们目前也尚不支持 OIDC。

    # 故障排除

    ### Login with SAML config failed: Firebase: Error (auth/operation-not-allowed)

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta6.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=f65534799dfd8f941a68dc9fc72236d4" width="617" height="92" data-path="assets/auth/sso-okta6.png" />
    </Frame>

    这通常表示 SSO ID 无效或 SSO URL 不正确。请确保其为字母数字组合，且没有多余空格或无效字符。请再次按照本指南逐步核对，确保使用了正确的值。

    ### Login with SAML config failed: Firebase: SAML Response \<Issuer> mismatch. (auth/invalid-credential)

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/sso-okta7.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=446c8ad9510b7dcc8e744c7b80862c29" width="752" height="117" data-path="assets/auth/sso-okta7.png" />
    </Frame>

    这通常表示 IdP Entity ID 无效。请确保从 Okta 门户正确复制，且字符串前后没有任何多余字符或空格。

    ### Failed to verify the signature in samlresponse

    这表示 X509 certificate 的值不正确。请确保复制了正确的密钥，并且其格式如下：

    ```
    -----BEGIN CERTIFICATE-----
    value
    ------END CERTIFICATE------
    ```
  </Tab>

  <Tab title="Azure SCIM（跨域身份管理系统，一种用于自动化用户和群组供应的开放标准）">
    Windsurf 支持使用 Microsoft Entra ID / Azure AD 对用户和群组进行 SCIM 同步。使用 SCIM 同步无需先配置 SSO（单点登录），但强烈建议启用。

    你需要：

    * Microsoft Entra ID / Azure AD 的管理员权限
    * Windsurf 的管理员权限
    * 在 Entra ID 中已存在的 Windsurf 应用（通常来源于你现有的 SSO 应用）

    ## 第 1 步：进入现有的 Windsurf 应用

    在 Azure 中打开 Microsoft Entra ID，点击左侧边栏的 Enterprise applications，然后在列表中点击现有的 Windsurf 应用。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=c2425d24cadc8997c694a4b8a950169a" width="1258" height="664" data-path="assets/auth/scim-azure.png" />
    </Frame>

    ## 第 2 步：设置 SCIM 供应

    在中间的 Provision User Accounts 下点击 Get started（步骤 3），然后再次点击 Get started。

    <Frame>
      <img src="https://mintcdn.com/codeium/s3SYO8XdSvmrABvq/assets/auth/scim-azure2.png?fit=max&auto=format&n=s3SYO8XdSvmrABvq&q=85&s=1e9c8417da7568dc587941955f6d0ace" width="2582" height="1858" data-path="assets/auth/scim-azure2.png" />
    </Frame>

    在 Provisioning 设置页面中，选择以下选项。

    Provisioning Mode:  Automatic

    Admin Credentials > Tenant URL: [https://server.codeium.com/scim/v2](https://server.codeium.com/scim/v2)

    保持 Azure 的供应页面打开，然后前往 Windsurf Web 门户，在页面顶部导航栏点击个人资料图标。在 Team Settings 下选择 Service Key 并点击 Add Service Key。输入任意密钥名称（例如“Azure Provisioning Key”）并点击 Create Service Key。复制生成的密钥，回到 Azure 页面，将其粘贴到 Secret Token。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=80477c2c0d31631e38e217b22e9f42a3" width="1612" height="1013" data-path="assets/auth/scim-azure3.png" />
    </Frame>

    （在 Windsurf 上创建密钥后你应看到的内容）

    在 Provisioning 页面点击 Test Connection，应显示已验证 SCIM 连接。

    然后在 Provisioning 表单上方点击 Save。

    ## 第 3 步：配置 SCIM 供应

    点击 Save 后，Provisioning 页面应出现一个新选项 Mappings。展开 Mappings，并点击 Provision Microsoft Entra ID Users

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure4.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=276791b068bd34c2bcbe5321e95abfd6" width="666" height="438" data-path="assets/auth/scim-azure4.png" />
    </Frame>

    在 attribute Mappings 下，删除 displayName 下的所有字段，仅保留 userName、active 和 displayName 三个字段。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure5.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=ddb9440614a4bc04f7c561bbf64a2d5a" width="1260" height="190" data-path="assets/auth/scim-azure5.png" />
    </Frame>

    对于 active，点击 Edit。在 Expression 下，将该字段修改为

    ```
    NOT([IsSoftDeleted])
    ```

    然后点击“Ok”。

    你的用户属性应如下所示：

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure6.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=2beab12c979d3272d522293080634811" width="2826" height="490" data-path="assets/auth/scim-azure6.png" />
    </Frame>

    在 Attribute Mapping 页面，点击顶部的“Save”，然后返回到 Provisioning 页面。

    在同一页面的 Mappings 下，点击“Provision Microsoft Entra ID Groups”。仅删除 externalId，然后点击顶部的“Save”。返回到 Provisioning 页面。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure7.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=11e89ce7d057c455ea00e0f469351b61" width="1258" height="203" data-path="assets/auth/scim-azure7.png" />
    </Frame>

    在 Provisioning 页面底部，还有一个 Provisioning Status 开关。将其设置为“On”以启用 SCIM（跨域身份管理系统，一种用于自动化用户和群组供应的开放标准）同步。之后，Entra ID 应用的用户和群组将每 40 分钟同步到 Windsurf。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/scim-azure8.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=1214073ce82bd85a1c2a57834005608f" width="686" height="306" data-path="assets/auth/scim-azure8.png" />
    </Frame>

    点击“Save”完成操作。你已启用基于 SCIM 的用户和群组同步。只有分配给该应用的用户和群组会同步到 Windsurf。请注意，移除用户只会禁用其对 Windsurf 的访问权限（并释放其占用的席位），而不会删除该用户，这是 Azure 的 SCIM 机制所致。
  </Tab>

  <Tab title="Okta SCIM（跨域身份管理系统，一种用于自动化用户和群组供应的开放标准）">
    Windsurf 支持与 Okta 的用户和群组进行 SCIM 同步。使用 SCIM 同步不必先设置 SSO（单点登录），但强烈推荐配置 SSO。

    你需要：

    * Okta 的管理员权限
    * Windsurf 的管理员权限
    * 在 Okta 中已存在的 Windsurf 应用（通常来自你现有的 SSO 应用）

    ## 步骤 1：前往现有的 Windsurf 应用

    打开 Okta，点击左侧边栏的 Applications，然后在应用列表中点击现有的 Windsurf 应用。

    ## 步骤 2：启用 SCIM 供应

    在 General 选项卡的 App Settings 中，点击右上角的 Edit。勾选“Enable SCIM Provisioning”复选框，然后点击 Save。顶部应出现一个新的 Provisioning 选项卡。

    接着进入 Provisioning，点击 Edit，并在以下字段填写：

    SCIM connector base URL: [https://server.codeium.com/scim/v2](https://server.codeium.com/scim/v2)

    Unique identifier field for users: email

    Supported provisioning actions: Push New Users, Push Profile Updates, Push Groups

    Authentication Mode: HTTP Header

    对于 HTTP Header - Authorization，可按以下步骤生成令牌：

    * 访问 [https://windsurf.com/team/settings，进入](https://windsurf.com/team/settings，进入) Other Settings，找到 Service Key Configuration
    * 点击 Add Service Key，并为密钥命名
    * 复制 API 密钥，返回 Okta 并粘贴到 HTTP Header - Authorization

    填写完 Provisioning Integration 后，点击 Save。

    ## 步骤 3：设置 Provisioning

    在 Provisioning 选项卡下，左侧会出现两个新子标签。点击 To App，然后点击 Edit Provisioning to App。勾选 Create Users、Update User Attributes 和 Deactivate Users，点击 Save。

    完成此步骤后，分配到该应用的所有用户将会同步到 Windsurf。

    ## 步骤 4：设置群组 Provisioning（可选）

    如需将群组同步到 Windsurf，需要指定要推送的群组。在该应用下，点击顶部的 Push Groups 选项卡。点击 + Push Groups -> Find Groups by name。筛选你要添加的群组，确保勾选 Push group memberships immediately，然后点击 Save。该群组将被创建，群组成员会同步到 Windsurf。随后可在 Analytics 页面中按群组筛选分析数据。
  </Tab>

  <Tab title="SCIM（跨域身份管理系统，一种用于自动化用户和群组供应的开放标准）API">
    本指南介绍如何使用 SCIM API 在 Windsurf 中创建和维护群组。

    有些情况下,用户可能希望手动配置群组而不是通过身份提供商(Azure/Okta)来配置。公司可能希望从 Windsurf 无法访问的其他内部数据源(HR 网站、源代码管理工具等)配置群组,或者公司可能需要比其身份提供商提供的更精细的群组控制。因此,可以通过 HTTP 请求使用 API 来创建群组。以下提供了通过 CURL 进行 HTTP 请求的示例。

    这里有 5 个主要 API:创建群组、添加群组成员、替换群组成员、删除群组和列出群组中的用户。

    ### 创建群组

    ```
    curl -k -X POST https://server.codeium.com/scim/v2/Groups -d '{
    "displayName": "<群组名称>",
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]
    }' -H "Authorization: Bearer <API 密钥>" -H "Content-Type: application/scim+json"
    ```

    ### 添加组成员

    ```
    curl -X PATCH https://server.codeium.com/scim/v2/Groups/<群组名称> -d '{"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations":[
    {
    "op": "add",
    "path":"members",
    "value": [{"value": "<邮箱 1>"}, {"value": "<邮箱 2>"}]
    }]}' -H "Authorization: Bearer <API 密钥>" -H "Content-Type: application/scim+json"
    ```

    ### 替换组成员

    ```
    curl -X PATCH https://server.codeium.com/scim/v2/Groups/<群组名称> -d '{"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations":[
    {
    "op": "replace",
    "path":"members",
    "value": [{"value": "<邮箱 1>"}, {"value": "<邮箱 2>"}]
    }]}' -H "Authorization: Bearer <API 密钥>" -H "Content-Type: application/scim+json"
    ```

    ### 删除群组

    ```
    curl -X DELETE https://server.codeium.com/scim/v2/Groups/<群组名称> -H "Authorization: Bearer <API 密钥>" -H "Content-Type: application/scim+json"
    ```

    ### 列表组

    ```
    curl -X GET -H "Authorization: Bearer <API 密钥>" "https://server.codeium.com/scim/v2/Groups"
    ```

    ### 列出群组中的用户

    ```
    curl -X GET -H "Authorization: Bearer <API 密钥>" "https://server.codeium.com/scim/v2/Groups/<群组 ID>"
    ```

    您需要先创建组,然后替换该组以创建包含成员的组。如果您的组名包含特殊字符(如空格),还需要对组名进行 URL 编码,例如名为'Engineering Group'的组在 URL 中必须写成'Engineering%20Group'。

    请注意,用户需要先在 Windsurf 中创建(通过 SCIM(跨域身份管理系统,一种用于自动化用户和群组供应的开放标准)或手动创建账户),然后才能被添加到群组中。

    ## 用户 API

    同时也为用户提供了相应的 API。以下是 Windsurf 支持的一些常见 SCIM（跨域身份管理系统,一种用于自动化用户和群组供应的开放标准)API。

    禁用用户（启用时将 false 改为 true）:

    ```
    curl -X PATCH \
      https://server.codeium.com/scim/v2/Users/<用户 API 密钥> \
      -H 'Content-Type: application/scim+json' \
      -H 'Authorization: Bearer <api secret key>' \
      -d '{
        "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
        "Operations": [
          {
            "op": "replace",
            "path": "active",
            "value": false
          }
        ]
      }'
    ```

    创建用户:

    ```
    curl -X POST \
      https://server.codeium.com/scim/v2/Users \
      -H 'Content-Type: application/scim+json' \
      -H 'Authorization: Bearer <API 密钥>' \
      -d '{
        "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
        "userName": "<email>",
        "displayName": "<full name>",
        "active": true,
    }'
    ```

    更新名称:

    ```
    curl -X PATCH \
      'https://<企业门户网址>/_route/api_server/scim/v2/Users/<用户 API 密钥>' \
        -H 'Authorization: Bearer <服务密钥>' \
        -H 'Content-Type: application/scim+json' \
        -d '{
          "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
          "Operations": [
            {
              "op": "Replace",
              "path": "displayName",
              "value": "<新名称>"
            }
          ]
       }'
    ```

    ## 创建 API 密钥

    前往 [https://windsurf.com/team/settings。在服务密钥配置下,点击\&quot;配置\&quot;,然后点击\&quot;添加服务密钥\&quot;。输入任意密钥名称(如\&quot;Azure](https://windsurf.com/team/settings。在服务密钥配置下,点击\&quot;配置\&quot;,然后点击\&quot;添加服务密钥\&quot;。输入任意密钥名称\(如\&quot;Azure) Provisioning Key")并点击"创建服务密钥"。复制生成的密钥并保存,现在您可以使用该密钥来授权上述 API。
  </Tab>

  <Tab title="Duo">
    ## 先决条件

    本指南假设你已将 Duo 配置为组织的 IdP，或已配置外部 IdP。

    你需要拥有 Duo 和 Windsurf 账户的管理员权限。

    ## 为 Windsurf 配置 Duo

    1. 前往 Applications，并添加一个 Generic SAML 服务提供商

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/duo-sso-1.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=7e598d7e9a9ee2c3884caa1c60ba68ff" width="2230" height="920" data-path="assets/auth/duo-sso-1.png" />
    </Frame>

    2. 在 Team Settings 中前往 SSO

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/windsurf-sso-team-settings.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=df8dde8b5b66a27532a3f42cdd803a17" width="1676" height="1444" data-path="assets/auth/windsurf-sso-team-settings.png" />
    </Frame>

    3. 首次启用 SAML 时，你需要设置 SSO ID。**之后将无法更改。**

       建议仅使用字母和数字，将其设为你的组织或团队名称。

    4. 在 Duo 门户中复制 `Entity ID`，并粘贴到 Windsurf 门户的 `IdP Entity ID` 字段。

    5. 在 Duo 门户中复制 `Single Sign-On URL`，并粘贴到 Windsurf 门户的 `SSO URL` 字段。

    6. 在 Duo 门户中复制证书值，并粘贴到 Windsurf 门户的 `X509 Certificate` 字段

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/duo-sso-3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=a7594c846a32e958a1bacfc01c5d3ef3" width="1536" height="290" data-path="assets/auth/duo-sso-3.png" />
    </Frame>

    7. 在 Windsurf 门户中复制 `SP Identity ID`，并粘贴到 Duo 门户的 `Entity ID` 字段。

    8. 在 Windsurf 门户中复制 `Callback URL (Assertion Consumer Service URL)`，并粘贴到 Duo 门户的 `Assertion Consumer Service (ACS) URL` 字段。

    9. 在 Duo 门户中，按如下方式配置属性声明：

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/duo-sso-4.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=bb3b514b94a6b0ebba19aa492c8be4a2" width="1676" height="290" data-path="assets/auth/duo-sso-4.png" />
    </Frame>

    10. 在 Windsurf 门户中启用 SAML 登录，以便进行测试。

    **注意：此时不要注销或关闭窗口。**

    如果出现错误或超时，请排查你的设置；否则你将不得不在 Windsurf 门户中禁用 SAML 设置。

    **如果在未确认测试成功的情况下注销或关闭窗口，你可能会被锁定在外。**

    11. 测试成功后，你可以注销。之后在访问团队/组织页面时，可使用第 3 步中配置的 SSO ID 进行 SSO 登录。

    [https://www.codeium.com/yourssoid/login](https://www.codeium.com/yourssoid/login)
  </Tab>

  <Tab title="PingID">
    ## 先决条件

    本指南假设你已将 PingID 配置为组织的 IDP，或已配置外部 IDP。

    你需要对 PingID 和 Windsurf 账户都拥有管理员权限。

    ## 为 Windsurf 配置 PingID

    1. 前往 Applications，并将 Windsurf 添加为 SAML Application

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/pingid-1.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=f86f6145e0eac599178ca9d9ee66b776" width="2258" height="1068" data-path="assets/auth/pingid-1.png" />
    </Frame>

    2. 在 Team Settings 中进入 SSO

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/windsurf-sso-team-settings.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=df8dde8b5b66a27532a3f42cdd803a17" width="1676" height="1444" data-path="assets/auth/windsurf-sso-team-settings.png" />
    </Frame>

    3. 首次启用 SAML 时，你需要设置 SSO ID。**之后将无法更改。**

    建议仅使用字母和数字，将其设置为你的组织或团队名称。

    4. 在 PingID 中选择手动输入配置，并按以下内容填写字段：

    * ACS URLs - 使用来自 Windsurf 门户的 `Callback URL (Assertion Consumer Service URL)`。
    * Entity ID - 使用来自 Windsurf 门户的 `SP Entity ID`。

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/pingid-3.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=e33dc0b9d021309da0fcdb2ac4f08bbb" width="974" height="672" data-path="assets/auth/pingid-3.png" />
    </Frame>

    5. 将 PingID 中的 `Issuer ID` 复制到 Windsurf 门户中的 `IdP Entity ID`。

    6. 将 PingID 中的 `Single Signon Service` 复制到 Windsurf 门户中的 `SSO URL`。

    7. 从 PingID 下载签名证书（X509 PEM 格式，.crt），打开文件并将其内容复制到 Windsurf 门户中的 `X509 Certificate`。

    **注意**：请确保包含完整的起始与结束行（各含 5 个短横线 -），且不要多复制任何其他字符！

    8. 在属性映射中，确保映射：

    * `saml_subject` - Email Address
    * `firstName` - Given Name
    * `lastName` - Family Name

    <Frame>
      <img src="https://mintcdn.com/codeium/DnGnXhZxl1qb2EWt/assets/auth/pingid-4.png?fit=max&auto=format&n=DnGnXhZxl1qb2EWt&q=85&s=4ff17f07bfb897072fb68e212ee2ac12" width="1398" height="780" data-path="assets/auth/pingid-4.png" />
    </Frame>

    9. 按你的环境/组织需求，添加或编辑其他策略和访问控制。

    10. 在 Windsurf 门户中启用 SAML 登录，以便进行测试。

    **注意：此时不要登出或关闭窗口。**

    如果出现错误或超时，请排查配置；否则你需要在 Windsurf 门户中禁用 SAML 设置。

    **如果在未确认测试成功的情况下登出或关闭窗口，你可能会被锁定在外。**

    11. 测试成功后，你可以登出。此后访问使用第 3 步配置的 SSO ID 的团队/组织页面时，可使用 SSO 登录。

    [https://www.codeium.com/yourssoid/login](https://www.codeium.com/yourssoid/login)
  </Tab>
</Tabs>
