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

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