在 Identity Platform 中設定多用戶群架構
本快速入門導覽課程說明如何使用 Google Cloud 控制台,在 Identity Platform 中啟用多租戶功能,以及建立及選取新租戶。
如要進一步瞭解 Identity Platform 中的多用戶群架構,請參閱多用戶群架構。
如要直接在 Google Cloud 控制台中,按照這項工作的逐步指南操作,請按一下「Guide me」(逐步引導):
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
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.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
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.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
必要的角色
如要取得設定多租戶所需的權限,請要求管理員授予您專案的「Identity Platform 管理員 」(roles/identityplatform.admin) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
這個預先定義的角色具備設定多重租戶所需的權限。如要查看確切的必要權限,請展開「Required permissions」(必要權限) 部分:
所需權限
如要設定多租戶,您必須具備下列權限:
-
firebaseauth.configs.update -
identitytoolkit.tenants.create
啟用多用戶群架構
在 Google Cloud 控制台中,前往「Identity Platform」>「Settings」(設定) 頁面。
前往「設定」按一下 [Security] (安全性) 分頁標籤。
在「多重租戶」部分,按一下「允許租戶」。
系統會啟用多租戶架構,並開啟「Tenants」(租戶) 頁面。
您現在可以建立第一個租戶。
建立用戶群
在「Tenants」(租戶) 頁面中,按一下「Add tenant」(新增租戶)。
在「Name」(名稱) 欄位中,輸入租戶名稱。 這項 ID 不必是專屬 ID,Identity Platform 會自動指派不同的 ID。
按一下 [儲存]。
恭喜!您已建立 Identity Platform 租戶。
選取租戶
在「設定」頁面中,從「範圍限定為租戶」清單中選取租戶。
每個租戶都有自己的供應商和使用者。選取租戶後,管理方式與管理非租戶 Identity Platform 專案相同。
停用多用戶群架構
如要停用多重租戶功能,請使用 Identity Toolkit API。