OpenAI
页面内容为机器翻译。查看英文原文

Google Workspace - 管理员管理设置

更新于:16 days ago

要使用管理员管理设置将 Google Workspace 连接到 ChatGPT,你需要先在 Google 的管理员控制台中配置访问权限:

  • 创建服务账号,并授予对 Google Drive、用户和群组的只读访问权限。

    • 强烈建议在与你的 ChatGPT 工作空间关联的同一个 Google 账号下创建此服务账号。如果 ChatGPT 工作空间中的账号邮箱域名与 Google Workspace 中使用的域名不同,则需要执行额外步骤,才能为你的用户启用此连接器。

  • 创建管理员账号,供服务账号代表其执行操作。

然后,在 ChatGPT 管理员控制台中完成设置:

  • 上传服务账号的私钥(Google 提供的 JSON 文件)

  • 指定管理员账号(无需凭据)。

  • 选择要同步的文件选择哪些用户可以访问该连接。

本指南将逐步介绍这 6 个步骤。

设置服务账号

  1. 前往 console.cloud.google.com

  2. 点击项目下拉菜单。图片请确保你登录的是与你的 ChatGPT 工作空间关联的同一个 Google Workspace(如果你的 ChatGPT 工作空间未关联 Google Workspace,且两者使用的邮箱不同,则你需要执行额外步骤,否则你的用户可能无法使用 Google Drive 同步连接器)。

  3. 选择 New Project

    Google Cloud Select a resource dialog with dolores-lab.com organization selected
  4. 输入一个 Project Name

    Google Cloud New Project form with organization dolores-lab.com selected and Create button available
  5. 创建项目

    Google Cloud New Project form with ChatGPT Google Connector entered under the dolores-lab.com organization
  6. 等待项目创建完成,然后点击 Select Project

    Google Cloud notifications confirm creation of the ChatGPT Google Connector project for dolores-lab.com
  7. 点击 APIs & Services

    Image
  8. 点击 Library

    Image
  9. 现在我们将添加三个 API,使用搜索框来查找它们

    Google Cloud API Library page with the ChatGPT Google Connector project selected
  10. 搜索并选择 Google Drive API

    Google Cloud API Library search results for Google Drive API in the ChatGPT Google Connector project
  11. 点击 Enable

    Google Cloud Console Google Drive API page with the Enable button for the ChatGPT Google Connector project
  12. 点击 Library

    Google Drive API details page with the API enabled and Create Credentials available
  13. 搜索 Google Drive Activity

    Google Cloud API Library open for the ChatGPT Google Connector project
  14. 选择 Google Drive Activity API

    Google Cloud API Library search results for Google Drive Activity API
  15. 点击 Enable

    Image
  16. 点击 Library

    Google Cloud Console Drive Activity API details page with the API enabled and Create credentials available
  17. 搜索 Admin SDK API

    Google Cloud API Library page for the ChatGPT Google Connector project
  18. 选择 Admin SDK API

    Google Cloud API Library search results for Admin SDK API with Admin SDK API listed
  19. 点击 Enable

    Google Cloud Admin SDK API page with the Enable button for the ChatGPT Google Connector project
  20. 点击 Credentials

    Google Cloud Admin SDK API details page with the API enabled and Create credentials button available
  21. 点击 Create Credentials

    Google Cloud APIs & Services Credentials page with Configure consent screen button
  22. 点击 Service account

    Google Cloud Credentials page with Create credentials menu open for API key, OAuth client ID, or service account
  23. 为此服务账号提供你选择的名称描述

    Google Cloud Create service account page with Service Accounts selected and service account details fields
  24. (可选)你可以分配角色——这不是 ChatGPT 所必需的。

    Google Cloud Create service account page with optional IAM role step and Service account created confirmation
  25. (可选)你可以向该服务账号授予访问权限——这不是 ChatGPT 所必需的。

    Google Cloud Create service account step 3 with Done button and Service account created confirmation
  26. 点击 Done

    Create service account step 3 in Google Cloud with Done button and Service account created confirmation
  27. 点击刚刚创建的服务账号

    Google Cloud Credentials page listing the newly created ChatGPT Google Connector service account
  28. 点击 keys.

    Google Cloud IAM service account details for ChatGPT Google Connector, enabled after creation
  29. 点击 Add Key

    Image
  30. 点击 Create new key

    Google Cloud service account Keys tab with Add key menu open to create or upload a key
  31. 保留默认的 JSON 密钥类型,然后点击 Create
    如果你看到提示“Service account key creation is disabled”的错误信息,请按照这些步骤启用创建。

    Create private key dialog for ChatGPT Google Connector with JSON key type selected
  32. 点击 Close。密钥现在已下载到你的计算机。稍后你需要将其上传到 ChatGPT 管理员控制台。

    Google Cloud service account Keys tab with confirmation that a private key JSON file was saved to the computer
  33. 点击 details

    Google Cloud service account Keys tab for ChatGPT Google Connector with Add Key button
  34. 记下 Unique ID。在步骤 42 中会用到。

    Google Cloud service account details for ChatGPT Google Connector with status Enabled
  35. 展开 Advanced settings

    Google Cloud service account details for ChatGPT Google Connector with the account enabled
  36. 向下滚动并点击 View Google Workspace Admin Console。Google Workspace 控制台会在新标签页中打开。

    Image
  37. 点击 Show more

    Google Workspace Admin console home page for dolores-lab.com
  38. 展开 Security 部分

    Image
  39. 展开 Access and data controls 部分

    Google Workspace Admin console home with Security section expanded in the left navigation
  40. 点击 API controls 部分

    Google Workspace Admin console home with Security > Access and data control expanded in the sidebar
  41. 点击 Manage Domain Wide Delegation

    Google Admin console API controls page under Security > Access and data control
  42. 点击 Add new

    Google Admin Domain-wide Delegation page with API clients list and Add new option
  43. 使用之前记下的 Unique ID 作为此 Client ID 的值

    Google Admin Domain-wide Delegation dialog for adding a new client ID and OAuth scopes
  44. 对于 OAuth scopes,请参阅以下用逗号分隔的授权范围值,你需要复制并粘贴:

https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/drive.activity.readonly, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/userinfo.email
范围原因
admin.directory.group.readonly执行基于群组的权限控制
admin.directory.group.member.readonly执行基于群组的权限控制
admin.directory.user.alias.readonly处理用户通过别名被授予权限的情况
drive.activity.readonly在文件发生更改时接收通知
drive.metadata.readonly同步文件内容及相关元数据(例如最后修改日期)
drive.readonly同步文件内容及相关元数据(例如最后修改日期)
userinfo.profile确定我们正在为哪些用户同步文件
userinfo.email确定我们正在为哪些用户同步文件
Google Admin Domain-wide Delegation dialog for adding a new client ID and OAuth scopes

45. 点击 Authorize

Image

46. 成功!

Image

设置管理员账号

  1. 展开 Directory

    Google Admin Domain-wide Delegation page with a ChatGPT API client and scopes listed
  2. 点击 Users

    Google Admin domain-wide delegation page listing a ChatGPT Google Connector API client and scopes
    Google Admin console Users page listing workspace accounts for setup and management
  3. 输入你选择的名字姓氏主电子邮件地址

    Google Admin console Add new user form for creating a Workspace user at dolores-lab.com
  4. 点击 Add new user

    Google Admin console Add new user form filled for a ChatGPT Connector account
  5. (可选)记录这些凭据。ChatGPT 不需要这些凭据。

    Google Admin Console New user added page for ChatGPT Connector with Copy Password and Done actions
  6. 点击 Done

    Google Admin console Copy password dialog for a newly created user account
  7. 点击你刚刚创建的账号。如果它未显示在列表中,请刷新页面,或清除缓存和 Cookie 后重试。

    Google Admin console Users page listing accounts including ChatGPT Connector
  8. 点击 assign roles

    Google Admin user details page for the ChatGPT Connector service account
  9. 启用 Groups Reader、User Management AdminStorage Admin 角色。

    Google Admin ChatGPT Connector user page with Admin roles and privileges open and no roles assigned
  10. 向下滚动并点击 Save. 管理员账号现已成功创建并配置完成。

Image

在 ChatGPT 管理员控制台中完成设置

  1. 前往 ChatGPT,然后点击页面右上角的个人资料图标。

    Image
  2. 点击 Manage workspace

    ChatGPT workspace menu with Manage workspace selected under the organization switcher
  3. 点击 Connections ,然后在 “Synced connectors” 下点击 → Enable Sync

    Connectors page with Google Drive sync prompt and Enable Sync button highlighted
  4. 确保已选择 Admin-managed,然后点击 Next

    Google Drive connection setup with Admin-managed setup selected over Self-service setup
  5. 输入一个显示名称。我们建议使用你的 Google Workspace 名称。

    请注意,我们目前不支持更改连接名称。

    Google Workspace connector setup dialog with display name Dolores Labs entered
  6. 点击 Save Draft and Continue

  7. 点击 Upload key。选择 JSON 文件,即你在上方设置服务账号时下载的密钥。请确保此密钥准确无误

    Google Workspace connection setup step prompting upload of a service account key and admin email address
  8. 输入管理员电子邮件地址。这是你之前创建的管理员账号。

    Image
  9. 点击 Save.

    ChatGPT Connections credentials dialog with service account key and Google Workspace admin email entered
  10. 选择是否要包含所有用户的“我的云端硬盘”中的文件。

    ChatGPT Connections modal for User files with Include user My Drives enabled at step 2 of 5
  11. 点击 Next

    ChatGPT admin Connections modal for User files with Include user My Drives enabled in step 2 of 5
  12. 选择如何管理共享云端硬盘。我们支持以下三种情况:

    1. 如果你想包含所有共享云端硬盘,请选择 Include by default ,并且不要添加要排除的共享云端硬盘 ID

    2. 如果你想包含大多数共享云端硬盘,请选择 Include by default,并添加你想排除的共享云端硬盘 ID

    3. 如果你想排除大多数共享云端硬盘,请选择 Exclude by default,并添加你想包含的共享云端硬盘 ID

    ChatGPT admin Shared drives setup with Include by default selected and an Excluded Shared drives field
  13. 要查找共享云端硬盘的 ID,请在网页浏览器中打开该共享云端硬盘。URL 的最后一部分就是共享云端硬盘 ID。
    在以下示例中,它是 `0ADvY03uUbEcQUk9PVA`'

    Google Drive shared drive with Manage members visible for Example Shared Drive
  14. 点击 Next

    ChatGPT admin Connections modal for Shared drives with Include by default selected at step 3 of 5
  15. 选择谁应该有权访问 Google Drive 连接。你可以只选择 ChatGPT 工作空间的管理员,或向所有人启用。如果向所有人启用,后来添加到工作空间的新用户也会自动包含在内。

    Google Drive connector permission set to Admins only for workspace members
  16. 点击 Start syncing

    Image
  17. 你的 Google Drive 连接现已成功创建!
    请注意,虽然它会立即开始同步,但根据你的设置所包含的文件数量不同,完成同步可能需要数小时到数天。
    过去 30 天内新增/编辑的文件完成同步后,此连接器将对你已启用的用户可用。

    Image

启用服务账号密钥创建

如果你收到以下错误,则需要为这个特定项目启用服务账号创建:

> 你的组织已强制执行组织政策约束“iam.disableServiceAccountKeyCreation”。

Google Cloud service account Keys tab with error that service account key creation is disabled
  1. 打开一个新标签页并前往 console.cloud.google.com。确保所选项目是你之前已选择的那个。
    点击左上角的菜单图标

    Google Cloud Console welcome page for the ChatGPT Google Connector project
  2. 将鼠标悬停在 IAM & Admin

    Google Cloud Console navigation with IAM & Admin open and Organization Policies selected
  3. 点击 Organizational Policies

    Google Cloud Console IAM & Admin menu opened to Organization Policies
  4. 搜索 iam.disableServiceAccountKeyCreation

    Google Cloud organization policies for the ChatGPT Google Connector project
  5. 点击 constraints/iam.disableServiceAccountKeyCreation 的结果

    Image
  6. 点击 ID 为 iam.disableServiceAccountKeyCreation 的行上的 …

    Organization policies filtered to Disable service account key creation for the ChatGPT Google Connector project
  7. 点击 Edit policy。如果 Edit policy 被禁用,你需要成为 Organization Policy Administrator。

    Google Cloud Organization Policies filtered to Disable service account key creation with Edit policy menu open
  8. 点击 Override parent’s policy

    Image
  9. 点击 Add a rule

    Edit policy page for Disable service account key creation with Override parent's policy selected
  10. 点击 Set Policy

    Google Cloud Edit policy page with Override parent's policy selected and enforcement set to Off
  11. 现在你可以创建服务账号密钥了。此启用可能需要几分钟才能生效。

Google Cloud policy details with Disable service account key creation set to Not enforced

成为 Organization Policy Administrator

  1. 前往 console.cloud.google.com 并点击项目/组织选择器

    Google Cloud welcome page for the ChatGPT Google Connector project
  2. 点击你的组织

    Image
  3. 点击左上角的菜单图标

    Image
  4. 将鼠标悬停在 IAM & Admin

    Google Cloud console navigation menu open with Google Cloud Setup pinned
  5. 点击 IAM

    Image
  6. 点击你账号对应的铅笔图标

    Google Cloud IAM page for dolores-lab.com showing organization permissions and the Grant Access action
  7. 点击 Add Another Role

    Google Cloud IAM dialog assigning the Organization Administrator role for dolores-lab.com
  8. 搜索 Organization Policy Administrator

    Google Cloud IAM edit access dialog assigning the Organization Administrator role to a user
  9. 点击 Organization Policy Administrator

    Google Cloud IAM role picker with Organization Policy Administrator selected while editing access
  10. 点击 Save

    Google Cloud IAM access editor assigning Organization Administrator and Organization Policy Administrator roles
  11. 你的账号现在拥有启用服务账号密钥创建的权限。此更改可能需要几分钟才能生效。

使用 Google 邮箱别名,在 Google Workspace 和 ChatGPT 之间保留不同的邮箱账号

如果你是管理员,正在使用适用于 Google Drive 同步连接器的管理员管理设置将 Google Workspace 连接到你的 ChatGPT 工作空间,而你的组织对 ChatGPT 和 Google Workspace 使用不同的邮箱域名,则你需要执行额外步骤,以确保用户能够成功访问 Google Drive 同步连接器。

建议:在可能的情况下,Google Workspace 和 ChatGPT 账号尽量使用相同的主电子邮件地址。

如果这不可行,请按照以下说明配置一个与 ChatGPT 登录邮箱匹配的 Google Workspace 邮箱别名。

添加 Google Workspace 别名的步骤

请在 Google Admin Console 中按照以下步骤操作,以确保每位用户的 ChatGPT 电子邮件都能关联到其 Google Workspace 账号:

  1. 前往 Admin Console。导航到:Directory > Users

Image

2. 选择一个用户,然后点击“ADD ALTERNATIVE EMAILS”。

Google Admin user details page with Add alternate emails action highlighted

3. 添加一个备用邮箱。确保它与该用户的 ChatGPT 账号对应。

Google Workspace Admin alternate email alias form with alias-testing-alt-email on bytesheaven.com

4. 选择 Save


已知限制

不支持个人电子邮件地址

使用个人地址(例如 example@gmail.com)注册 ChatGPT 的用户无法连接到 Google Workspace。此设置不受支持,并且存在安全风险,因为它会使组织外部能够访问内部数据。

不支持 Gmail “+” 别名

Gmail 允许用户通过在地址后附加“+”来创建别名(例如 user+alias@gmail.com)。这种别名方式不适用于 Google Drive 同步连接器。必须在 Google Workspace 中显式配置该别名。

常见错误信息

如果电子邮件地址未正确关联,用户可能会看到这条消息:“We were unable to connect your account to Google Drive. Click to learn more.”

如果用户收到这条消息,请检查本文档中的步骤,并确保已准确执行。如果还需要更多帮助,请联系支持团队

这篇文章对你有帮助吗?