设置 Google Workspace 主机名许可名单

在设置 Google Workspace 时,您需要将一些主机名添加到许可名单,以便 Google Workspace API 正常运行。

重要提示

  • 此信息可能会有变更,恕不另行通知。
  • 如需特定产品的 API 相关信息,请参阅相应产品的帮助中心内容。

第 1 步:打开连接端口

打开以下端口:

端口 目的
TCP 端口 443 (HTTPS) 访问用于身份验证和 API 调用的主要网址
TCP 端口 80 (HTTP) 允许进行 CRL 和 OCSP 检查(参见本页面下文中的第 4 步)

注意

  • 根据您的设置和应用,您可能需要允许其他规则。
  • 如果您使用的是 Microsoft Windows 客户端,则可能需要为每一个应用启用这些规则。有关详情,请参阅相关 Microsoft 文档。

第 2 步:允许相关网址

有什么新变化?

  • 2023 年 1 月 17 日 - 为 Google Workspace 教育版服务中嵌入的 YouTube 视频添加网址

    自此功能被回滚以来,我们改进了其性能和质量,并于 2024 年 8 月开始重新推出该功能。如果贵组织目前允许或禁止在 Google Workspace 教育版服务中访问 YouTube 视频,您就需要将“www.youtubeeducation.com”添加到相应许可名单或屏蔽名单中,以便贵组织延续之前在 Google Workspace 教育版服务中使用 YouTube 视频的方式。

  • 2022 年 5 月 2 日 - 添加了 Google Chat 的网址
  • 2021 年 3 月 31 日 - 添加了 Google Meet 的网址,并将 Google 通讯录标为了已弃用

顶级网址

允许 Google Workspace API 访问以下网址:

目的 网址
身份验证

有关详情,请参阅 Using OAuth 2.0 for Web Server Applications(针对网络服务器应用使用 OAuth 2.0)

https://accounts.google.com/o/oauth2
https://www.googleapis.com/oauth2
https://oauth2.googleapis.com/token
https://accounts.google.co.[您所在国家/地区的标识符]

例如 https://accounts.google.co.jp

主要 API 入口点 https://*.googleapis.com

(其中 * 是不包含句点的任何字符串)

生成式 AI

https://gemini.google.com
https://notebooklm.google.com
https://aistudio.google.com

面向 Google Workspace 用户的服务

https://drive.google.com
https://docs.google.com
https://sheets.google.com
https://slides.google.com
https://sites.google.com
https://meet.google.com
https://calendar.google.com
https://keep.google.com
https://script.google.com

电子邮件 除主要 API 入口点外,还需添加以下网址:
https://mail.google.com/mail
通讯录和全局地址列表 (GAL) https://www.google.com/m8
Google Workspace 管理设置 API https://apps-apis.google.com/a
账号和登录 https://www.google.com/accounts/ClientLogin
https://www.google.com/accounts/

提示:您可能还需要允许 https://www.googleapis.com/generate_204,此网址可用来检查 HTTP 状态代码 (204)。

(可选)用于额外控制的网址

要进行额外控制,您还可以允许以下网址:

目的 网址
更多身份验证网址

根据您的设置,您可能并不需要将这些网址全部列入白名单。

https://accounts.google.com/o/oauth2/auth
https://accounts.google.com/o/oauth2/token
https://accounts.google.com/o/oauth2/v2/auth
https://oauth2.googleapis.com/token
https://www.googleapis.com/oauth2/v3/token
https://www.googleapis.com/oauth2/v4/token
https://www.googleapis.com/oauth2/v2/tokeninfo
https://www.googleapis.com/oauth2/v3/tokeninfo
https://accounts.google.com/o/oauth2/revoke
https://accounts.youtube.com
https://www.google.com
https://fonts.gstatic.com
https://ssl.gstatic.com
https://www.gstatic.com
https://*.googleusercontent.com/* https://scf.usercontent.goog
Gmail 然后 Gmail API https://mail.google.com/mail https://www.googleapis.com/gmail https://www.googleapis.com/upload/gmail
Google Calendar API https://www.googleapis.com/calendar
Google Chat https://chat.google.com
https://mail.google.com/chat
Google Classroom API https://classroom.googleapis.com
Google 通讯录 API

(不推荐使用。建议使用 People API。)

https://www.google.com/m8/feeds
全局地址列表 (GAL)

Google Workspace Admin SDK 然后 Domain Shared Contacts API

https://www.google.com/m8/feeds/gal
Google Drive API https://www.googleapis.com/drive https://www.googleapis.com/upload/drive
Google Drive Activity API https://www.googleapis.com/appsactivity
Google Meet https://*.googlevideo.com/*
https://*.youtube-nocookie.com/*
https://*.ytimg.com/*
Google Sheets API https://sheets.googleapis.com
Google Slides API https://slides.googleapis.com
Google Tasks API https://www.googleapis.com/tasks
Google Workspace Admin SDK 然后 Data Transfer API https://www.googleapis.com/admin/datatransfer
Google Workspace Admin SDK 然后 Directory API https://www.googleapis.com/admin/directory
Google Workspace Admin SDK 然后 Enterprise License Manager API https://www.googleapis.com/apps/licensing
Google Workspace Admin SDK 然后 Groups Migration API https://www.googleapis.com/upload/groups
Google Workspace Admin SDK 然后 Groups Settings API https://www.googleapis.com/groups
Google Workspace Admin SDK 然后 Reports API https://www.googleapis.com/admin/reports
People API https://people.googleapis.com
Google Workspace 教育版服务中嵌入的 YouTube 视频 https://www.youtubeeducation.com

教育版管理员注意事项:Google Workspace 教育版服务中嵌入的 YouTube 视频的网址仅供 Google Workspace 教育版管理员使用。只有当您使用第三方服务来允许或屏蔽特定网域时,才需要将 www.youtubeeducation.com 添加到许可名单或屏蔽名单中。

第 3 步:检查 Google IP 地址范围

了解如何查找 Google IP 地址范围。 第 2 步中指定的任何 Google 网址都可以使用 Google IP 地址。

您也可以通过 Google 管理员工具箱测试连接。

第 4 步:允许检查

CRL 检查

证书吊销列表 (CRL) 列出了在预设的失效日期之前被证书授权机构 (CA) 吊销的数字证书。系统不应信任这些证书。

CA 网站上的 HTTP(非 HTTPS)网址通常会发送 CRL。您可以在证书 X509v3 详细信息中找到 CRL 分布点。

以下是 Google 服务目前使用的 CRL 分布点:

  • http://crl.pki.goog
  • http://crls.pki.goog
  • http://c.pki.goog

有关详情,请参阅 Google Trust Services

OCSP 检查

在线证书状态协议 (OCSP) 是一种用来获取 X.509 数字证书吊销状态的互联网协议。

Google 服务目前使用的 OCSP 分发点是 http://ocsp.pki.goog。


Google、Google Workspace 以及相关标志和徽标是 Google LLC 的商标。其他所有公司名和产品名是其各自相关公司的商标。