Method: projects.locations.authorizations.storeUserAuthorization

將 OAuth 授權憑證換成更新權杖,並儲存更新權杖和範圍。儲存的資料會以資源名稱和使用者 ID (來自使用者憑證) 做為鍵值。

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
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

詳情請參閱Authentication Overview。

IAM 權限

需要 name 資源的下列 IAM 權限:

  • discoveryengine.authorizations.storeUserAuthorization

詳情請參閱 IAM 說明文件。