Method: projects.locations.authorizations.acquireUserAuthorization

使用儲存的更新權杖,找出以使用者憑證和指定資源識別的使用者,並傳回產生的存取權杖及其詳細資料。如果快取中有存取權杖,則會從快取中取得。視需要輪替儲存的重新整理權杖。

HTTP 要求

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

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

路徑參數

參數
name

string

這是必要旗標,Authorization 的資源名稱。格式:projects/{project}/locations/{location}/authorizations/{authorization}

要求主體

要求主體必須為空白。

回應主體

[AuthorizationService.AcquireAuthorization][] 方法的回應訊息。

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

JSON 表示法
{
  "refreshTokenInfo": {
    object (RefreshTokenInfo)
  },
  "accessToken": string,
  "authorizationUri": string
}
欄位
refreshTokenInfo

object (RefreshTokenInfo)

用於建立存取權杖的已儲存更新權杖相關資訊。

accessToken

string

建立的存取權杖。

authorizationUri

string

觸發授權流程的 URI。設定使用者需要 (重新) 授權的時間。

授權範圍

需要下列其中一種 OAuth 範圍:

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

詳情請參閱Authentication Overview

RefreshTokenInfo

說明更新權杖。

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

string

這個權杖的範圍清單。