Method: projects.locations.authorizations.storeUserAuthorization

将 OAuth 授权凭证交换为刷新令牌,并存储该刷新令牌和范围。存储的数据将以资源名称和最终用户凭证中的用户标识符作为键。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/authorizations/*}:storeUserAuthorization

网址采用 gRPC 转码语法。

路径参数

参数
name

string

必需。Authorization 的资源名称。格式:projects/{project}/locations/{location}/authorizations/{authorization}

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "fullRedirectUri": string
}
字段
fullRedirectUri

string

必需。授权后用户重定向到的 URI,包括所有参数。例如,https://example.com/redir?code=5

响应正文

如果成功,则响应正文为空。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 name 资源的以下 IAM 权限:

  • discoveryengine.authorizations.storeUserAuthorization

如需了解详情,请参阅 IAM 文档