在 Identity Platform 中设置多租户
本快速入门介绍如何为 Identity Platform 启用多租户,以及如何使用 Google Cloud 控制台创建和选择新租户。
如需详细了解 Identity Platform 中的多租户,请参阅多租户。
如需在 Google Cloud 控制台中直接遵循有关此任务的分步指导,请点击操作演示:
准备工作
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
如果您要使用现有项目来完成本指南,请验证您是否拥有完成本指南所需的权限。如果您创建了新项目,则您已拥有所需的权限。
-
Verify that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
如果您要使用现有项目来完成本指南,请验证您是否拥有完成本指南所需的权限。如果您创建了新项目,则您已拥有所需的权限。
-
Verify that billing is enabled for your Google Cloud project.
-
firebaseauth.configs.update -
identitytoolkit.tenants.create
所需的角色
如需获得设置多租户所需的权限,请让您的管理员为您授予项目的 Identity Platform Admin (roles/identityplatform.admin) IAM 角色。如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
此预定义角色包含设置多租户所需的权限。如需查看所需的确切权限,请展开所需权限部分:
所需权限
如需设置多租户,您需要具备以下权限:
启用多租户
在 Google Cloud 控制台中,前往 Identity Platform > 设置页面。
前往“设置”点击安全标签。
在多租户部分,点击允许多租户。
此操作会启用多租户并打开租户页面。
您现在可以创建第一个租户了。
创建租户
在租户页面中,点击添加租户。
在名称字段中,输入租户的名称。 该名称不必是唯一的;Identity Platform 会自动分配不同的 ID。
点击保存。
恭喜!您已创建 Identity Platform 租户。
选择租户
在设置页面中,从限定到租户列表中选择您的租户。
每个租户都有自己的提供商和用户。选择租户后,您可以像管理非租户 Identity Platform 项目一样管理该租户。
停用多租户
如需停用多租户,请使用 Identity Toolkit API。