Google 凭据(Google credentials)#
本节包含:
🌐 This section contains:
- OAuth2 单一服务:为特定服务节点(例如 Gmail 节点)创建 OAuth2 凭证。有两种选项:
- 托管 OAuth2:直接在 n8n 上使用 Google 登录,无需在 Google Cloud 控制台上进行设置。仅适用于 n8n 云用户,适用于某些 Google 节点。
- 自定义 OAuth2:在 Google Cloud 控制台中配置 OAuth2 应用,并将其连接到你的 n8n 凭证。
- OAuth2 API(通用):创建一个 OAuth2 凭证以用于自定义操作。
- 服务账户:为某些特定的服务节点创建一个服务账户凭证。
- Google PaLM 和 Gemini:获取 Google Gemini/Google PaLM API 密钥。
OAuth2 和服务账户(OAuth2 and Service Account)#
Google 服务节点有两种身份验证方法:
🌐 There are two authentication methods available for Google services nodes:
- OAuth2:推荐使用,因为它更普遍可用且更容易设置。
- 服务账号:有关何时需要服务账号的指导,请参阅谷歌文档:理解服务账号。
为 n8n Cloud 用户管理的 OAuth2(Managed OAuth2 for n8n Cloud users)#
托管 OAuth2 可用于 n8n Cloud 用户的以下 Google 节点。这提供了简化的凭证创建过程:
- Google Calendar
- Google Calendar Trigger
- Google Contacts
- Google Docs
- Google Drive
- Google Drive Trigger
- Google Mail
- Google Mail Trigger
- Google Sheets
- Google Sheets Trigger
- Google Slides
- Google Tasks
兼容节点(Compatible nodes)#
配置完成后,你可以使用你的凭据来验证以下节点。大多数节点兼容 OAuth2 验证。对服务账户验证的支持有限。
🌐 Once configured, you can use your credentials to authenticate the following nodes. Most nodes are compatible with OAuth2 authentication. Support for Service Account authentication is limited.
| 节点 | OAuth | 服务账号 |
| :--- | :---: | :-------------: |
| 谷歌广告 | |
|
| Gmail | :白色对勾: | :警告: |
| Google Analytics | :白色对勾: | |
| Google BigQuery | |
|
| Google 图书 | |
|
| Google 日历 | |
|
| Google 聊天 | |
|
| 谷歌云存储 | |
|
| Google 联系人 | |
|
| 谷歌云 Firestore | |
|
| Google Cloud 自然语言 | |
|
| Google 云实时数据库 | |
|
| Google 文档 | |
|
| 谷歌云端硬盘 | |
|
| Google 云端硬盘触发器 | |
|
| Google Perspective | :白色对勾: | :叉: |
| Google 表格 | |
|
| Google 幻灯片 | |
|
| Google 任务 | |
|
| 谷歌翻译 | |
|
| Google Workspace 管理员 | |
|
| YouTube | :白色对勾: | |
Gmail 和服务账号
从技术上讲,Google 支持使用服务帐号访问 Gmail,但这需要启用域范围委托,而 Google 不鼓励这样做,而且其行为可能不一致。
n8n 建议在 Gmail 节点使用 OAuth2。