Method: projects.locations.collections.dataConnector.acquireAndStoreRefreshToken

Exchanges OAuth authorization credentials for a refresh token and stores the refresh token and the scopes. The stored data will be keyed by the connector name and the user identifier from the EUC.

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Connector resource.

The connector name identifies the 3rd party system to use for authorization. It is also used as a key to store the refresh token.

Request body

The request body contains data with the following structure:

JSON representation
{
  "scopes": [
    string
  ],
  "fullRedirectUri": string
}
Fields
scopes[]

string

The scopes of the authorization code and the refresh token.

fullRedirectUri

string

Required. The URI the user is redirected to after authorization, including all parameters. E.g., https://example.com/redir?code=5

Response body

Response message for DataConnectorService.AcquireAndStoreRefreshToken method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "additionalOauthResponses": [
    {
      object (AdditionalOAuthResponse)
    }
  ]
}
Fields
additionalOauthResponses[]

object (AdditionalOAuthResponse)

Optional. Additional OAuth responses from the authorization response. This field is optional and will not always be populated. It depends on the connector's type and the authorization response.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • discoveryengine.dataConnectors.acquireAndStoreRefreshToken

For more information, see the IAM documentation.

AdditionalOAuthResponse

Additional OAuth responses from the authorization response.

JSON representation
{
  "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.
}
Fields
key

string

The key of the additional OAuth response.

Union field value. The value of the additional OAuth response. value can be only one of the following:
stringValue

string

The string value of the additional OAuth response.

intValue

string (int64 format)

The integer value of the additional OAuth response.

boolValue

boolean

The boolean value of the additional OAuth response.