在 Identity Platform 中設定多用戶群架構
本快速入門導覽課程說明如何使用 Google Cloud 控制台,在 Identity Platform 中啟用多租戶功能,以及建立及選取新租戶。
如要進一步瞭解 Identity Platform 中的多用戶群架構,請參閱多用戶群架構。
如要直接在 Google Cloud 控制台中,按照這項工作的逐步指南操作,請按一下「Guide me」(逐步引導):
事前準備
- 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 管理員」 (roles/identityplatform.admin) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
這個預先定義的角色具備設定多租戶所需的權限。如要查看確切的必要權限,請展開「Required permissions」(必要權限) 部分:
所需權限
如要設定多重租戶,您必須具備下列權限:
啟用多用戶群架構
在 Google Cloud 控制台中,前往「Identity Platform」>「Settings」(設定) 頁面。
前往「設定」按一下 [Security] (安全性) 分頁標籤。
在「多租戶」部分,按一下「允許租戶」。
這會啟用多租戶架構,並開啟「Tenants」(租戶) 頁面。
現在可以建立第一個租戶了。
建立用戶群
在「Tenants」(租戶) 頁面中,按一下「Add tenant」(新增租戶)。
在「Name」(名稱) 欄位中,輸入租戶名稱。 這項 ID 不必是專屬 ID,Identity Platform 會自動指派不同的 ID。
按一下 [儲存]。
恭喜!您已建立 Identity Platform 租戶。
選取租戶
在「設定」頁面中,從「將範圍限定為租戶」清單中選取租戶。
每個租戶都有自己的供應商和使用者。選取租戶後,管理方式與管理非租戶 Identity Platform 專案相同。
停用多用戶群架構
如要停用多用戶群架構,請使用 Identity Toolkit API。