OAuth2 Account

Overview

You can use this account type to connect the HTTP Client Snap with data sources that use the OAuth2 account.

Prerequisites

Valid Client ID, Client secret, OAuth2 Endpoint, and OAuth2 Token.

Account settings



Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique label for the account.

Default value: N/A

Example: HTTP Client OAuth2 Account
Client ID String Required. Specify the OAuth Client ID associated with your account. You can create the client ID as advised by your application provider.

Default value: N/A

Example: bcptk3dmg19btc1ahofqw5bhzrhg

Client secret String Specify the OAuth Client secret associated with your account.

Default value: N/A

Example: jhktz@wld*(687

Send client data as Basic Auth header Checkbox Select this checkbox to pass the client data as part of the Basic Auth header when generating a token.

Default status: Deselected

Access token String Autogenerated on account authorization. The access token is used to make API requests on behalf of the user associated with the client ID.

Default value: N/A

Example: <Encrypted>

Refresh token String

Autogenerated after authorization. Specify the refresh token associated with your account. If the refresh token is stored, then the access token can be refreshed automatically before it expires.

You should retrieve the Refresh token when setting up the account for the endpoint, where the OAuth2 flow is executed and the resulting refresh token is stored in this field. If the refresh token is stored, then the access token can be refreshed automatically before it expires.

Default value: N/A

Example: <Encrypted>

Access token expiration Integer Autogenerated on account authorization. The number of seconds after which the access token expires.

Default value: Current Time + 3600 seconds

Example: 1663659049

Header authenticated Checkbox Select this checkbox if the endpoint uses bearer header authentication.

Default status: Deselected

OAuth2 Endpoint String Specify the URL of the endpoint that authorizes the application.

Default value: N/A

Example: https://www.box.com/api/oauth2/token

OAuth2 Token String Specify the URL of the endpoint that retrieves the token for an authenticated account.
Warning: If you are using a REST OAuth2 Account, access the account token through account.access_token explicitly. The property must be marked as an expression. An example URL for LinkedIn is:
"https://api.linkedin.com/v1/people/~?oauth2_access_token=" +
    account.access_token.

Default value: N/A

Example: https://www.box.com/api/oauth2/token

Grant Type Dropdown list Select the method of authorization.
  • Authorization Code: The user account is authenticated using credentials (username and password), which return to the client through a redirect URL. The application then receives the authorization code from the URL and uses it to request an access token.

  • Client Credentials: Obtains an access token for the client ID and client secret through the token endpoint URL.

  • Password: Obtains an access token using your log-in credentials (username and password). When selected, it populates the following fields:
    • Username: Specify the username of the account type.

    • Password: Specify the password of the account type.

Default value: authorization_code

Example: authorization_code

Token endpoint config Use this field set to define custom properties for the OAuth2 token endpoint. This endpoint returns access tokens or refresh tokens depending on the request parameters.
Token endpoint parameter String Specify the parameter for the token endpoint.

Default value: N/A

Example: scope

Token endpoint parameter value String Specify the value for the token endpoint parameter.

Default value: N/A

Example: profile, user

Auth endpoint config Use this fieldset to define custom properties for the OAuth2 authentication endpoint.
Authentication parameter String Specify the parameter for the token endpoint.

Default value: N/A

Example: scope

Authentication parameter value String Specify the value for the OAuth2 authentication parameter.

Default value: N/A

Example: profile, user

Snaplex String Specify the Snaplex path to be used for OAuth2 operations.
Note:
  • By default, SnapLogic automatically selects an available Snaplex. So, use this field only to handle specific scenarios, such as a network limitation.

  • If the specified Snaplex is not available or does not exist, the execution fails.

Default value: N/A

Example: /snaplogic/shared/cloud

Auto-refresh token Checkbox Select this checkbox to enable autorefresh of the access token before it expires.

Default status: Deselected

Note:

The Redirect URL must be set in the following format in the app that is created in the endpoint:

https://<control-plane-name>.snaplogic.com/api/1/rest/admin/oauth2callback/<snap-pack-name>where the <control-plane-name> corresponds to the domain part of your SnapLogic URL—elastic (global control plane) or emea (EMEA control plane). For example:

https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/apisuite

You must append the Snap Pack name at the end of the Redirect URI; otherwise, your account will be unauthorized.