Skip to content

Okta Workforce Identity SAML 设置#

¥Okta Workforce Identity SAML setup

在使用 Okta 的 n8n 中设置 SAML 单点登录 (SSO)。

¥Set up SAML SSO in n8n with Okta.

Workforce Identity and Customer Identity

本指南涵盖了 Workforce Identity 的设置。这是 Okta 的原始产品。Customer Identity 是 Okta 对其收购的 Auth0 的名称。

¥This guide covers setting up Workforce Identity. This is the original Okta product. Customer Identity is Okta's name for Auth0, which they've acquired.

先决条件#

¥Prerequisites

你需要 Okta Workforce Identity 账户,以及来自 n8n SAML 设置中的重定向 URL 和实体 ID。

¥You need an Okta Workforce Identity account, and the redirect URL and entity ID from n8n's SAML settings.

根据你的 Okta 配置,Okta Workforce 可能会强制用户进行双因素身份验证。

¥Okta Workforce may enforce two factor authentication for users, depending on your Okta configuration.

首先阅读 设置 SAML 指南。

¥Read the Set up SAML guide first.

设置#

¥Setup

除了以下说明外,此 PDF 还提供了关于如何在 n8n 中使用 Okta 设置 SAML 的可视化分步指南。

¥In addition to the following instructions, this PDF provides visual step-by-step guide on how to setup SAML in n8n with Okta.

  1. 在 Okta 管理面板中,选择“应用”>“应用”。

¥In your Okta admin panel, select Applications > Applications.

  1. 选择“创建应用集成”。Okta 打开应用创建模态框。

¥Select Create App Integration. Okta opens the app creation modal.

  1. 选择“SAML 2.0”,然后选择“下一步”。

¥Select SAML 2.0, then select Next.

  1. 在“常规设置”选项卡中,输入 n8n 作为应用名称。

¥On the General Settings tab, enter n8n as the App name.

  1. 选择“下一步”。

¥Select Next .

  1. 在“配置 SAML”选项卡上,填写以下常规字段:

¥On the Configure SAML tab, complete the following General fields:

  • 单点登录 URL:来自 n8n 的重定向 URL。

    ¥Single sign-on URL: the Redirect URL from n8n.

  • 受众 URI(SP 实体 ID):来自 n8n 的实体 ID。

    ¥Audience URI (SP Entity ID): the Entity ID from n8n.

  • 默认中继状态:留空。

    ¥Default RelayState: leave this empty.

  • ID 名称格式:EmailAddress

    ¥Name ID format: EmailAddress.

  • 应用用户名:Okta username

    ¥Application username: Okta username.

  • 更新应用用户名:Create and update

    ¥Update application username on: Create and update.

  1. 创建属性语句:

¥Create Attribute Statements:

名称 名称格式
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/firstname URI 引用 user.firstName
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/lastname URI 引用 user.lastName
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn URI 引用 user.login
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress URI 引用 user.email
  1. 选择“下一步”。Okta 可能会提示你填写营销表单,或者直接将你引导至新的 n8n Okta 应用。

¥Select Next. Okta may prompt you to complete a marketing form, or may take you directly to your new n8n Okta app.

  1. 将 n8n 应用分配给用户:

¥Assign the n8n app to people: 1. 在 Okta 的 n8n 应用控制面板中,选择“分配”。

1
  ¥On the n8n app dashboard in Okta, select **Assignments**.
  1. 选择“分配”>“分配给人员”。Okta 显示一个模态框,其中包含可用人员列表。

    ¥Select Assign > Assign to People. Okta displays a modal with a list of available people. 3. 选择要添加的人员旁边的“分配”。Okta 显示一个提示,要求确认用户名。

    ¥Select Assign next to the person you want to add. Okta displays a prompt to confirm the username. 4. 用户名保留为电子邮件地址。选择“保存并返回”。

    ¥Leave the username as email address. Select Save and Go Back. 5. 选择“完成”。

    ¥Select Done.

  2. 获取元数据 XML在“登录”选项卡中,复制元数据 URL。导航至该报告并复制 XML。将此 URL 粘贴到 n8n 中的“身份提供商设置”中。

    ¥Get the metadata XML: on the Sign On tab, copy the Metadata URL. Navigate to it, and copy the XML. Paste this into Identity Provider Settings in n8n.

  3. 选择“保存设置”。

    ¥Select Save settings.

  4. 选择“测试设置”。n8n 打开一个新标签页。如果你当前未登录,Okta 会提示你登录。然后,n8n 会显示一条成功消息,确认 Okta 返回的属性。

    ¥Select Test settings. n8n opens a new tab. If you're not currently logged in, Okta prompts you to sign in. n8n then displays a success message confirming the attributes returned by Okta.

实例和项目访问权限配置#

¥Instance and project access provisioning

请参阅 设置 SAML 页面 文档了解此功能的更多信息。

¥See the Set up SAML page for additional information of this feature.

添加必需属性

¥Adding the required attributes

  1. 在 Okta 管理面板中,选择“应用”>“应用”。

¥In your Okta admin panel, select Applications > Applications.

  1. 前往 n8n 应用的配置。

¥Go to the configuration of your n8n application

  1. 在“常规”选项卡中,单击“SAML 设置”旁边的“编辑”。

¥On the General tab, click Edit next to SAML Settings

  1. 在打开的页面中,继续执行步骤 2:配置 SAML

¥In the page that opens, continue to step 2: Configure SAML

  1. 添加以下两个属性语句:

¥Add the following two Attribute Statements:

名称 名称格式
n8n_instance_role 基本 appuser.n8n_instance_role
n8n_projects 基本 appuser.n8n_projects
  1. 点击“下一步”

¥Click Next

  1. 点击“完成”

¥Click Finish

正在更新应用配置文件

¥Updating the app profile

  1. 在 Okta 管理面板中,选择“目录”>“配置文件编辑器”。

¥In your Okta admin panel, select Directory > Profile Editor. 2. 前往 n8n 应用的个人资料。

¥Go to the profile of your n8n application 3. 点击“添加属性”

¥Click Add Attribute 4. 添加 n8n_instance_role 属性

¥Add the n8n_instance_role attribute

  • 数据类型:string

    ¥Data type: string

  • 显示名称:n8n_instance_role

    ¥Display name: n8n_instance_role

  • 变量名称:n8n_instance_role

    ¥Variable name: n8n_instance_role

  • 属性类型:Group

    ¥Attribute type: Group 5. 添加 n8n_projects 属性

¥Add the n8n_projects attribute

  • 数据类型:字符串数组

    ¥Data type: string array

  • 显示名称:n8n_projects

    ¥Display name: n8n_projects

  • 变量名称:n8n_projects

    ¥Variable name: n8n_projects

  • 属性类型:Group

    ¥Attribute type: Group

  • 组优先级:跨组合并值

    ¥Group priority: Combine values across groups

现在,当你转到“目录”>“组”并编辑已分配的 n8n 应用时,你可以配置 n8n_instance_role 和 n8n_projects,以便在通过 SAML 登录时将其发送给 n8n。

¥Now when you go to Directory > Groups and edit the assigned n8n application, you can configure the n8n_instance_role and n8n_projects to be sent to n8n upon logging in via SAML.