Duaer

集成

在 Duaer 里配置 Google Service Account 凭证

在 Duaer 中保存 Google Service Account 的连接信息,供工作流程节点在运行时使用。密钥经实例加密密钥保护,不会写进节点参数。

创建服务账号密钥

Duaer 的 Google Service Account API 凭证用服务账号的 JSON 密钥登录,不需要浏览器授权:

  1. 在 Google Cloud 控制台打开 IAM & Admin → Service Accounts,新建服务账号。
  2. 打开该账号 → Keys → Add key → Create new key,选 JSON,下载文件。
  3. 把 JSON 里的 client_email 填进 Service Account Email,private_key 整段(含 BEGIN 和 END 两行)填进 Private Key。
  4. 在同一个项目里启用节点要用的 API。
  5. 用 Google Drive 或 Google Sheets 时,把目标文件或文件夹共享给服务账号邮箱。

要以某个 Google Workspace 用户的身份操作时,先在 Workspace 管理后台的 Security → API controls → Domain-wide delegation 里,为服务账号的客户端 ID 授权所需授权范围,再在凭证里打开 Impersonate a User 并填写 Email。

给 HTTP Request 节点用时,打开 Set up for use in HTTP Request node,在 Scope(s) 里填授权范围。其他节点会自动带上授权范围。

Duaer 里的 Google Service Account API 字段

在 Duaer 里新建 Google Service Account API 凭证,填写这些字段:

  • Region:Google Cloud 服务所在地域。只对部分节点生效,例如 Google Vertex Chat Model。默认 Global (multi-region) - global,可选 Global (multi-region) - global、EU (multi-region) - eu、US (multi-region) - us、Africa (Johannesburg) - africa-south1、Asia Pacific (Changhua County) - asia-east1、Asia Pacific (Hong Kong) - asia-east2 等 44 项。
  • Service Account Email(必填):Google 服务账号,形如 user-808@project.iam.gserviceaccount.com。
  • Private Key(必填,密钥):填写从 Google Cloud 控制台下载的 JSON 文件里的私钥。
  • Impersonate a User:默认关闭。
  • Email:应用要代为访问的那个用户的邮箱。Impersonate a User 打开时显示。
  • Set up for use in HTTP Request node:默认关闭。
  • Scope(s):各服务的授权范围见 https://developers.google.com/identity/protocols/oauth2/scopes。Set up for use in HTTP Request node 打开时显示。

使用它的 Duaer 节点:Evaluation Trigger、Evaluation、Google BigQuery、Google Books、Google Chat、Google Cloud Storage、Google Docs、Google Drive、Google Drive Trigger、Gmail、Gmail Trigger、Google Sheets、Google Sheets Trigger、Google Slides、Google Translate。

在 Duaer 里保存连接

打开 Credentials,创建 Google Service Account。按字段填写密钥、OAuth 或服务器地址。保存后,工作流程节点引用这份凭证,而不是把密钥写进参数。

凭证内容经实例的加密密钥保护。换密钥或弄丢密钥后,已存凭证会解不开,见托管文档里的加密密钥说明。

谁能用这份凭证

能否看到或编辑,取决于项目和角色。不要把密钥贴进聊天或变量。外部密钥库见外部密钥文档。

常见问题

Duaer 的 Google Service Account 凭证密钥会出现在节点参数里吗?

不会。在 Duaer 里,Google Service Account 的密钥保存在凭证中,节点只引用凭证。执行记录也不应出现明文密钥。

在 Duaer 里 Google Service Account 凭证保存失败常见原因是什么?

字段填错、OAuth 回调地址与实例 URL 不一致,或当前角色不能创建凭证。先核对 Google Service Account 服务商要求的字段,再确认你在该项目里有权新建凭证。

同组