为 reCAPTCHA Enterprise 准备环境

本文档介绍了如何准备环境以设置 reCAPTCHA Enterprise。

准备工作

要开始使用 reCAPTCHA Enterprise,请执行以下操作:

  1. 注册以在 Google Cloud 控制台中创建 Google 帐号。

  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

启用 reCAPTCHA Enterprise API

控制台

  1. 在 Google Cloud 控制台中,前往 reCAPTCHA Enterprise API 页面。

    转到 reCAPTCHA Enterprise API

  2. 验证项目名称是否显示在页面顶部的项目选择器中。

    如果您没有看到项目名称,请点击项目选择器,然后选择您的项目。

  3. 点击启用

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 如需在 gcloud 会话中设置 Google Cloud 项目,请运行 gcloud config set project 命令。将 PROJECT_ID 替换为您的 Google Cloud 项目 ID。
           gcloud config set project PROJECT_ID
           
  3. 如需启用 reCAPTCHA Enterprise API,请运行 gcloud services enable 命令:
             gcloud services enable recaptchaenterprise.googleapis.com
           
  4. 如需验证 reCAPTCHA Enterprise API 是否已启用,请运行 gcloud services list 命令:
             gcloud services list --enabled
           

    验证 reCAPTCHA Enterprise API 是否在已启用的 API 列表中列出。

配置角色和权限

如需获取设置 reCAPTCHA Enterprise 所需的权限,请让管理员授予您项目的以下 IAM 角色:

如需详细了解如何授予角色,请参阅管理访问权限

您也可以通过自定义角色或其他预定义角色来获取所需的权限。

如需详细了解 reCAPTCHA Enterprise 的访问权限控制,请参阅使用 IAM 进行访问权限控制

后续步骤