Files
nexus/wiki/concepts/测试用户.md
2026-04-21 16:03:27 +08:00

1.4 KiB
Raw Blame History

title, type, tags
title type tags
测试用户 concept
google-oauth
security
testing

Definition

测试用户Test User是 Google OAuth 中允许未经验证unverified应用进行测试的 Google 账号。通过在 Google Cloud Console 的 OAuth 客户端配置中添加测试用户,可以绕过"此应用未经 Google 验证"的安全限制。

问题背景

首次授权未验证应用时Google 会显示:

此应用未经 Google 验证 此应用请求访问您 Google 账号中的敏感信息。在开发者让该应用通过 Google 验证之前,请勿使用该应用。

添加测试用户步骤

  1. 打开 Google Cloud Console - Credentials
  2. 找到目标 OAuth 客户端 ID点击进入详情
  3. 找到 「目标对象」「测试用户」 部分
  4. 点击 「添加用户」
  5. 输入测试用 Google 邮箱地址
  6. 保存

限制

  • 仅限添加的测试用户可授权
  • 仅用于开发/测试用途
  • 生产环境需通过 Google 验证流程

典型应用场景

  • gog CLI 配置:首次配置时需要添加测试用户才能完成 OAuth 授权
  • 其他第三方 Google Workspace CLI 工具

相关概念

相关实体

  • GoogleOAuth 服务提供方
  • gog CLI:需要测试用户配置的 CLI 工具