在 Identity Platform 中设置多租户

本快速入门介绍如何为 Identity Platform 启用多租户,以及如何使用 Google Cloud 控制台创建和选择新租户。

如需详细了解 Identity Platform 中的多租户,请参阅多租户


如需在 Google Cloud 控制台中直接遵循有关此任务的分步指导,请点击操作演示

操作演示


准备工作

  1. 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.
  2. 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 (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. 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 (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  5. Verify that billing is enabled for your Google Cloud project.

启用多租户

  1. 在 Google Cloud 控制台中,前往 Identity Platform > 设置页面。
    前往“设置”

  2. 点击安全标签。

  3. 多租户部分,点击允许多租户

这样一来,您便可启用多租户并打开租户页面。

您现在可以创建第一个租户了。

创建租户

  1. 租户页面中,点击添加租户

  2. 名称字段中,输入租户的名称。 该名称不必是唯一的;Identity Platform 会自动分配不同的 ID。

  3. 点击保存

恭喜!您已创建 Identity Platform 租户。

选择租户

设置页面中,从限定到租户列表中选择您的租户。

每个租户都有自己的提供商和用户。选择租户后,您可以像管理非租户 Identity Platform 项目一样管理该租户。

停用多租户

如需停用多租户,请使用 Identity Toolkit API

后续步骤