Method: projects.locations.collections.dataConnector.acquireAndStoreRefreshToken

將 OAuth 授權憑證換成更新權杖,並儲存更新權杖和範圍。儲存的資料會以連接器名稱和 EUC 中的使用者 ID 為索引鍵。

HTTP 要求

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:acquireAndStoreRefreshToken

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

這是必要旗標,連接器資源。

連接器名稱會識別用於授權的第三方系統。這項值也會用來儲存更新權杖。

要求主體

要求主體包含下列結構的資料:

JSON 表示法
{
  "scopes": [
    string
  ],
  "fullRedirectUri": string
}
欄位
scopes[]

string

授權碼和更新權杖的範圍。

fullRedirectUri

string

這是必要旗標,授權後使用者重新導向的 URI,包括所有參數。例如:https://example.com/redir?code=5

回應主體

DataConnectorService.AcquireAndStoreRefreshToken 方法的回應訊息。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "additionalOauthResponses": [
    {
      object (AdditionalOAuthResponse)
    }
  ]
}
欄位
additionalOauthResponses[]

object (AdditionalOAuthResponse)

(選用步驟) 授權回應中的其他 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 value can be only one of the following:
  "stringValue": string,
  "intValue": string,
  "boolValue": boolean
  // End of list of possible types for union field value.
}
欄位
key

string

額外 OAuth 回應的金鑰。

聯集欄位 value。額外 OAuth 回應的值。value 只能是下列其中一項:
stringValue

string

額外 OAuth 回應的字串值。

intValue

string (int64 format)

額外 OAuth 回應的整數值。

boolValue

boolean

額外 OAuth 回應的布林值。