REST Resource: projects.locations.authorizations

資源:授權

Discovery Engine 授權資源。

JSON 表示法
{
  "name": string,
  "displayName": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "serverSideOauth2": {
    object (ServerSideOAuth2)
  }
  // End of mutually exclusive fields.
}
欄位
name

string

ID。授權的資源名稱。格式:projects/{project}/locations/{location}/authorizations/{authorization}

必須是 UTF-8 編碼的字串,長度上限為 1024 個字元。

displayName

string

這是必要旗標,授權的顯示名稱。

必須是 UTF-8 編碼字串,長度上限為 128 個字元。

授權設定。以下列出互斥欄位。回應中最多會設定一個欄位:
serverSideOauth2

object (ServerSideOAuth2)

伺服器端 OAuth2 設定。

互斥欄位的結尾。

ServerSideOAuth2

OAuth2 設定。

JSON 表示法
{
  "clientId": string,
  "clientSecret": string,
  "tokenUri": string,
  "authorizationUri": string,
  "scopes": [
    string
  ],
  "pkceVerificationEnabled": boolean,
  "basicAuthenticationEnabled": boolean,
  "privateNetworkConfig": {
    object (PrivateNetworkConfig)
  }
}
欄位
clientId

string

這是必要旗標,OAuth2 用戶端 ID。

clientSecret

string

這是必要旗標,OAuth2 用戶端密鑰。

靜態資料加密。

tokenUri

string

這是必要旗標,這個 HTTP 端點會將用戶端授權換成存取權杖。

authorizationUri

string

這是必要旗標,使用者需要授權時會前往的 URI。應包含授權成功所需的一切資訊,例如 OAuth ID、額外旗標等。範例:https://accounts.google.com/o/oauth2/v2/auth?clientId=OAUTH_ID&scope=https://www.googleapis.com/auth/calendar.events&responseType=code&access_type=offline&prompt=consent

redirectUri 參數會遭到 Vertex AI Search 前端覆寫。

scopes[]

string

選用。要要求的範圍。示例:https://www.googleapis.com/auth/calendar.events如果省略,系統不會要求授權 URI 以外的額外範圍。如果設定,在取得使用者授權時,會覆寫授權 URI 中的範圍。

pkceVerificationEnabled

boolean

選用。是否啟用 PKCE 驗證。https://datatracker.ietf.org/doc/html/rfc7636#section-3.1/

basicAuthenticationEnabled

boolean

選用。OAuth 權杖交換是否使用 HTTP 基本驗證 (client_secret_basic),而非在要求內容中傳送用戶端憑證 (client_secret_post)。如果是 true,憑證 (clientId:clientSecret) 會經過 Base64 編碼,並在 Authorization 標頭中傳送。部分 OAuth 提供者 (例如 Splunk) 需要 client_secret_basic。如果設為 false 或未設定,系統會使用預設的 client_secret_post。

privateNetworkConfig

object (PrivateNetworkConfig)

選用。只有在 OAuth 供應商未發布公開端點時才需要設定,在這種情況下,權杖交換必須透過執行個體所在的私人網路進行,而不是透過公開輸出。如果不設定,交易所會繼續使用公開出口。

PrivateNetworkConfig

識別代管 OAuth 提供者的執行個體,該執行個體只能透過私人網路連線。

JSON 表示法
{
  "instanceResource": string
}
欄位
instanceResource

string

這是必要旗標,代管 OAuth 提供者的執行個體資源名稱。如果是 Looker,則為 Looker 執行個體,格式為 projects/{project}/locations/{location}/instances/{instance}。

方法

acquireUserAuthorization

使用儲存的更新權杖,找出以使用者憑證和指定資源識別的使用者,並傳回產生的存取權杖及其詳細資料。

create

建立 Authorization。

delete

刪除 Authorization。

get

取得 Authorization。

list

列出 Engine 底下的所有 Authorization。

patch

更新 Authorization

storeUserAuthorization

以 OAuth 授權憑證換取更新權杖,並儲存更新權杖和範圍。