Skip to content
Platform

使用 Google Workspace 设置单点登录

Supabase 支持使用 Google Workspace(以前叫 G Suite)的单点登录(SSO)。

🌐 Supabase supports single sign-on (SSO) using Google Workspace (formerly known as G Suite).

第 1 步:打开 Google Workspace 网页和移动应用控制台 #

🌐 Step 1: Open the Google Workspace web and mobile apps console [#google-workspace-console]

Google Workspace: Web and mobile apps admin console

步骤 2:选择添加自定义 SAML 应用 #

🌐 Step 2: Choose to add custom SAML app [#add-custom-saml-app]

在工具栏的 添加应用 按钮中选择 添加自定义 SAML 应用。

🌐 From the Add app button in the toolbar choose Add custom SAML app.

Google Workspace: Web and mobile apps admin console, Add custom SAML app selected

步骤 3:填写应用详情 #

🌐 Step 3: Fill out app details [#add-app-details]

你在这里输入的信息是为了让你能够看到你的 Google Workspace。你可以随意选择任何值。Supabase 作为名称在大多数情况下都很适用。你也可以选择输入一个描述。

🌐 The information you enter here is for visibility into your Google Workspace. You can choose any values you like. Supabase as a name works well for most use cases. Optionally enter a description.

Google Workspace: Web and mobile apps admin console, Add custom SAML, App details screen

第4步:下载 IdP 元数据 #

🌐 Step 4: Download IdP metadata [#download-idp-metadata]

这是一个非常重要的步骤。点击 下载元数据 并保存下载的文件。你稍后在 步骤 10 中需要上传这个文件。

🌐 This is a very important step. Click on DOWNLOAD METADATA and save the file that was downloaded. You will need to upload this file later in Step 10.

Google Workspace: Web and mobile apps admin console, Add custom SAML, Google Identity Provider details screen

重要提示:确保屏幕上显示的证书至少在 1 年后才会过期。

步骤 5:添加服务提供商详情 #

🌐 Step 5: Add service provider details [#add-service-provider-details]

在下一个屏幕填写这些服务提供商的详细信息。

🌐 Fill out these service provider details on the next screen.

详情值
ACS URLhttps://alt.supabase.io/auth/v1/sso/saml/acs
实体 IDhttps://alt.supabase.io/auth/v1/sso/saml/metadata
起始 URLhttps://supabase.nodejs.cn/dashboard
名称 ID 格式PERSISTENT
名称 ID基本信息 > 主要邮箱

Google Workspace: Web and mobile apps admin console, Add custom SAML, Service provider details screen

第6步:配置属性映射 #

🌐 Step 6: Configure attribute mapping [#configure-attribute-mapping]

属性映射可以让 Supabase 在每次登录时获取你的 Google Workspace 用户信息。

🌐 Attribute mappings allow Supabase to get information about your Google Workspace users on each sign-in.

需要将 主电子邮件 映射到 email。 下面显示的其他映射是可选的,并且可以根据你的 Google Workspace 设置进行配置。如果不确定,可以按照显示的配置进行复制。

你在此屏幕上做的任何更改稍后将在步骤10:配置属性映射中使用。

🌐 Any changes you make from this screen will be used later in Step 10: Configure Attribute Mapping.

Google Workspace: Web and mobile apps admin console, Add custom SAML, Attribute mapping

步骤 7:配置用户访问 #

🌐 Step 7: Configure user access [#configure-user-access]

你可以配置哪些 Google Workspace 用户账号可以访问 Supabase。如果你想限制访问权限只给你的软件工程团队,这一点很重要。

🌐 You can configure which Google Workspace user accounts will get access to Supabase. This is important if you wish to limit access to your software engineering teams.

你可以点击“用户访问”卡片(或向下箭头)来配置此访问权限。按照屏幕上的说明操作即可。

🌐 You can configure this access by clicking on the User access card (or down-arrow). Follow the instructions on screen.

Google Workspace: Web and mobile apps admin console, Supabase app screen

步骤 8:在控制面板中启用单点登录 #

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

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

步骤9:配置域名 #

🌐 Step 9: 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

第10步:配置元数据 #

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

把你在 步骤 6 下载的元数据文件上传到元数据上传文件栏里。

🌐 Upload the metadata file you downloaded in Step 6 into the Metadata Upload File field.

Metadata configuration with Google Workspace

第11步:配置属性映射 #

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

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

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

Attribute mapping configuration

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

🌐 Step 12: 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.

步骤 13:保存更改 #

🌐 Step 13: 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.