跳到主内容

将 Google Workspace 添加为 SAML 提供商

本指南解释了如何让用户通过 SAML 使用其 Google Workspace 账户登录到 Casdoor。


学习目标​

  • 在 Google Workspace 中为 Casdoor 创建一个自定义 SAML 应用。
  • 在 Casdoor 中将 Google Workspace 添加为 SAML 提供商。

所需条件​

  • Google Admin console 的管理员访问权限
  • Casdoor 管理控制台的管理员访问权限

在 Google Workspace 中创建 SAML 应用​

  1. 在 Google Admin console (admin.google.com) 中,前往 Apps > Web and mobile apps。

  2. 单击添加应用 > 添加自定义SAML应用。

  3. 输入 App name,例如 Casdoor,并可选择添加图标。点击 Continue。

  4. Download the metadata, or note the SSO URL, the Entity ID, and the Certificate. 单击继续。

  5. 输入服务提供商详细信息:

    FieldValue
    ACS URLhttps://<your-casdoor-domain>/api/acs, for example https://door.example.com/api/acs
    实体 IDThe same URL
    Name ID formatEMAIL
    Name IDBasic Information > Primary email

    Google Workspace sends the response with HTTP POST, which the /api/acs endpoint requires. .单击继续。

  6. Optionally, map attributes, for example email to Primary email, and displayName to First name and Last name. 单击完成。

  7. 为你的组织或允许登录的组织单元将应用设置为 ON。

在 Casdoor 中添加提供商​

  1. 在 Casdoor admin console 中,前往 Identity > Providers 并添加一个提供商。
  2. 将 Category 设置为 SAML,将 Type 设置为 Custom。
  3. 将来自 Google Workspace 的元数据粘贴到 Metadata 中,然后点击 Parse。
  4. 检查 SP ACS URL 和 SP Entity ID 是否为 https://<your-casdoor-domain>/api/acs,然后保存该提供商。
  5. 打开你的应用编辑页面,在 Providers 选项卡中添加该提供商,然后保存。

验证结果​

打开应用的登录页面,点击 Google Workspace 按钮。

另请参阅​