将 OAuth 授权凭据换成刷新令牌,并存储刷新令牌和范围。存储的数据将以连接器名称和 EUC 中的用户标识符作为键。
HTTP 请求
POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:acquireAndStoreRefreshToken
网址采用 gRPC 转码语法。
路径参数
参数 | |
---|---|
name |
必需。连接器资源。 连接器名称用于标识要用于授权的第三方系统。它还用作存储刷新令牌的密钥。 |
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
---|
{ "scopes": [ string ], "fullRedirectUri": string } |
字段 | |
---|---|
scopes[] |
授权代码和刷新令牌的范围。 |
fullRedirectUri |
必需。用户在授权后重定向到的 URI,包括所有参数。例如, |
响应正文
DataConnectorService.AcquireAndStoreRefreshToken
方法的响应消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
---|
{
"additionalOauthResponses": [
{
object ( |
字段 | |
---|---|
additionalOauthResponses[] |
可选。授权响应中的其他 OAuth 响应。此字段是可选字段,不会始终填充。这取决于连接器的类型和授权响应。 |
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/discoveryengine.readwrite
https://www.googleapis.com/auth/discoveryengine.assist.readwrite
如需了解详情,请参阅 Authentication Overview。
IAM 权限
需要拥有 name
资源的以下 IAM 权限:
discoveryengine.dataConnectors.acquireAndStoreRefreshToken
如需了解详情,请参阅 IAM 文档。
AdditionalOAuthResponse
授权响应中的其他 OAuth 响应。
JSON 表示法 |
---|
{ "key": string, // Union field |
字段 | |
---|---|
key |
其他 OAuth 响应的键。 |
联合字段 value 。其他 OAuth 响应的值。value 只能是下列其中一项: |
|
stringValue |
其他 OAuth 响应的字符串值。 |
intValue |
其他 OAuth 响应的整数值。 |
boolValue |
其他 OAuth 响应的布尔值。 |