Skip to content
Platform

使用 Okta 设置单点登录

Supabase 支持使用 Okta 进行单点登录(SSO)。

🌐 Supabase supports single sign-on (SSO) using Okta.

第1步:在应用仪表板中选择创建应用集成 #

🌐 Step 1: Choose to create an app integration in the applications dashboard [#create-app-integration]

导航到 Okta 管理控制台的应用仪表板。点击 创建应用集成。

🌐 Navigate to the Applications dashboard of the Okta admin console. Click Create App Integration.

Okta dashboard: Create App Integration button

步骤 2:在应用集成对话框中选择 SAML 2.0 #

🌐 Step 2: Choose SAML 2.0 in the app integration dialog [#create-saml-app]

Supabase 支持 SAML 2.0 SSO 协议。在“创建新的应用集成”对话框中选择它。

🌐 Supabase supports the SAML 2.0 SSO protocol. Choose it from the Create a new app integration dialog.

Okta dashboard: Create new app integration dialog

步骤 3:填写常规设置 #

🌐 Step 3: Fill out general settings [#add-general-settings]

你在这里输入的信息用于查看你的 Okta 应用菜单。你可以选择任何喜欢的值。‘Supabase’ 作为名称适用于大多数使用场景。

🌐 The information you enter here is for visibility into your Okta applications menu. You can choose any values you like. Supabase as a name works well for most use cases.

Okta dashboard: Create SAML Integration wizard

第4步:填写 SAML 设置 #

🌐 Step 4: Fill out SAML settings [#add-saml-settings]

这些设置让 Supabase 能够正确使用 SAML 2.0 与你的 Okta 应用。确保你按照表格中显示的完全一样输入这些信息。

🌐 These settings let Supabase use SAML 2.0 properly with your Okta application. Make sure you enter this information exactly as shown on in this table.

设置数值
单点登录 URLhttps://alt.supabase.io/auth/v1/sso/saml/acs
将此用于接收者 URL 和目标 URL✔️
受众 URI(SP 实体 ID)https://alt.supabase.io/auth/v1/sso/saml/metadata
默认 RelayStatehttps://supabase.nodejs.cn/dashboard
名称 ID 格式EmailAddress
应用用户名邮箱
更新应用用户名于创建和更新

Okta dashboard: Create SAML Integration wizard, Configure SAML step

第5步:填写属性声明 #

🌐 Step 5: Fill out attribute statements [#add-attribute-statements]

属性声明允许 Supabase 在每次登录时获取有关你的 Okta 用户的信息。

🌐 Attribute Statements allow Supabase to get information about your Okta users on each sign-in.

需要一个 email 到 user.email 的声明。 下面显示的其他映射是可选的,并且可以根据你的 Okta 设置进行配置。如果不确定,请复制所示的相同配置。稍后你将在步骤 10中使用此映射。

Okta dashboard: Attribute Statements configuration screen

步骤6:获取 IdP 元数据 URL #

🌐 Step 6: Obtain IdP metadata URL [#idp-metadata-url]

Supabase 需要完成与你的 Okta 应用的单点登录启用。

🌐 Supabase needs to finalize enabling single sign-on with your Okta application.

要执行此操作,请向下滚动到 Supabase 应用的 Sign On 选项卡中的 SAML Signing Certificates 部分。选择状态为 Active 的 SHA-2 行。点击 Actions 下拉按钮,然后点击 View IdP Metadata。

🌐 To do this scroll down to the SAML Signing Certificates section on the Sign On tab of the Supabase application. Pick the SHA-2 row with an Active status. Click on the Actions dropdown button and then on the View IdP Metadata.

这将会在浏览器的新标签页中打开 SAML 2.0 元数据 XML 文件。稍后你需要在步骤 9中输入这个 URL。

🌐 This will open up the SAML 2.0 Metadata XML file in a new tab in your browser. You will need to enter this URL later in Step 9.

链接通常是这个结构:https://<okta-org>.okta.com/apps/<app-id>/sso/saml/metadata

Okta dashboard: SAML Signing Certificates, Actions button highlighted

步骤7:在仪表板中启用单点登录 #

🌐 Step 7: Enable SSO in the Dashboard [#dashboard-enable-sso]

  1. 访问组织设置页面下的SSO标签。 SSO已禁用
  2. 切换 启用单点登录 以开始配置。启用后,配置表单将会出现。 已启用 SSO

步骤 8:配置域名 #

🌐 Step 8: Configure domains [#dashboard-configure-domain]

输入一个或多个与你用户邮箱地址相关的域名(例如,supabase.com)。这些域名决定哪些用户可以通过SSO登录。

🌐 Enter one or more domains associated with your users email addresses (e.g., supabase.com). These domains determine which users are eligible to sign in via SSO.

Domain configuration

如果你的组织使用多个电子邮件域名——例如,员工用 supabase.com,承包商用 supabase.io——你可以在这里添加多个域名。所有列出的域名都可以用于 SSO 登录。

🌐 If your organization uses more than one email domain - for example, supabase.com for staff and supabase.io for contractors - you can add multiple domains here. All listed domains will be authorized for SSO sign-in.

Domain configuration with multiple domains

第9步:配置元数据 #

🌐 Step 9: Configure metadata [#dashboard-configure-metadata]

在“元数据 URL”字段中输入你从 步骤 6 获取的元数据 URL:

🌐 Enter the metadata URL you obtained from Step 6 into the Metadata URL field:

Metadata configuration with Okta

第10步:配置属性映射 #

🌐 Step 10: Configure attribute mapping [#dashboard-configure-attributes]

把你在步骤5填写的 SAML 属性输入到属性映射部分。

🌐 Enter the SAML attributes you filled out in Step 5 into the Attribute Mapping section.

Attribute mapping configuration

第11步:注册时加入组织(可选)#

🌐 Step 11: Join organization on signup (optional) [#dashboard-configure-autojoin]

默认情况下,这个设置是关闭的,通过 SSO 登录的用户不会自动被添加到你的组织中。

🌐 By default this setting is disabled, users signing in via SSO will not be added to your organization automatically.

Auto-join disabled

如果你希望通过SSO登录的用户 在登录时自动加入你的组织,请开启此选项。自动加入适用于 每次登录,不仅仅是第一次注册——这让你在启用此功能前测试SSO也很安全。

🌐 Toggle this on if you want SSO-authenticated users to be automatically added to your organization when they sign in via SSO. Auto-join applies on every sign-in, not only on first signup - this makes it safe to test SSO before enabling this feature.

Auto-join enable

开启自动加入后,你可以为新用户选择默认角色:

🌐 When auto-join is enabled, you can choose the default role for new users:

Auto-join role selection

我们建议将 开发者 作为默认角色(最小权限原则),并根据需要单独提升用户权限。

🌐 We recommend choosing Developer as the default role (principle of least privilege) and promoting users individually as needed.

步骤12:保存更改 #

🌐 Step 12: Save changes [#dashboard-configure-save]

当你点击 保存更改 时,你的新 SSO 配置会立即生效。从那一刻起,任何使用与你配置的域名匹配的邮箱地址的用户访问你们组织的登录网址时,都会通过 SSO 流程进行。

🌐 When you click Save changes, your new SSO configuration is applied immediately. From that moment, any user with an email address matching one of your configured domains who visits your organization's sign-in URL will be routed through the SSO flow.