BasicAuth and OAuth2

This article describes how to configure a Webhook connector with BasicAuth, OAuth2 (2-legged), or OAuth2 (3-legged) authentication.

BasicAuth configuration

This webhook supports basic HTTP authentication using the HTTP header field Authorization. The credentials are passed as a Base64 encoded string of {username}:{password}.

Use the following configuration settings for the BasicAuth Webhook configuration:

Setting Description
Title Required. Enter a descriptive title for the webhook.
BasicAuth Username Enter the username of your webhook’s authentication.
BasicAuth Password Enter the password of your webhook’s authentication.

Click Next or go to the Actions tab. Use the Actions tab to configure the HTTP request to trigger.

OAuth2 (3-legged) configuration

Webhook’s OAuth implementation supports server-side applications only.

Be sure to register your web application with an OAuth 2.0 service. Your application must be configured to allow the redirect URL: https://my.tealiumiq.com/oauth/webhook/callback.html

Use the following configuration settings for the OAuth2 (3-legged) Webhook configuration:

Setting Description
Client ID Required. Enter the client identifier assigned to your application from the OAuth service.
Client Secret Required. Enter the client secret assigned to your application from the OAuth service.
Scope Select the type of permission you want to request to access the application.
Authorization URL Required. Enter the URL where you want to redirect the user after authorization.
Authorization URL Query Parameters Select one or more name-value pairs for the authorization URL. Separate multiple pairs using an ampersand (&). Do not use an ampersand (&) at the start.
Correct: access_type=offline&prompt=consent
Incorrect: &access_type=offline&prompt=consent
Access Token URL Required. Enter the token URL to get the refresh token.

OAuth2 (2-legged) configuration

Tealium’s Webhook OAuth2 connector allows you to send fully customized data as an HTTP request to an API of your choice that requires OAuth2 Two-Legged authorization and supports client credentials and resource owner password credentials grants.

After adding the connector, use the following configuration settings for the OAuth2 2-Legged Webhook configuration:

Setting Description
Access token URL Required. Enter the API endpoint URL to request an access token.
Client ID Required. Enter your web application client ID.
Client Secret Required. Enter your web application client secret.
Username Enter your username. Username is required if using Password grant type.
Password Enter your password. Password is required if using Password grant type.
Scope Select the scope of permissions to request (only required for some OAuth2 services).
Extra Authorization Parameters Add extra authorization parameters (only required for some OAuth2 services). Separate multiple parameters with &.
Authorization Token Location Specify where to place the authorization token.
Authorization Header Prefix Defaults value is Bearer. Specify a new value to override (only required for some OAuth2 services).

Access tokens for OAuth2

Requests using Webhook OAuth2 must supply the access token in the request. The token generated by your OAuth2 connection is provided by the connector in a template variable named {{webhook_access_token}}, which is passed differently between each API. In the following example, it is expected in the Authorization: Bearer TOKEN_HERE “Authorization” header.

Use the following steps generate and map this header:

  1. Create a template named auth_template using the following example:
    Bearer {{webhook_access_token}}
  2. In the Headers section, map this template to Authorization.
    Webhook Custom and Batched.jpg
  3. Click Save.
  4. Save and Publish your changes.

Action parameters for all webhook actions

The following parameters are available to all Webhook Actions.

Parameter Description
Method Required. Supports the following methods:
* GET
* POST
* PUT
* DELETE
* PATCH
URL* Required. Provide the URL to submit request to.
URL Parameters* From the Map drop-down list, select the attribute whose value you wish to send. In the To field, enter the name of the URL parameter to set.
Headers* Optional for Webhook (BasicAuth) Required for Webhook OAuth2. From the Map drop-down list, select the attribute whose value you wish to send. In the To field, enter the header name for the header to receive the value.
Cookies* From the Map drop-down list, select the attribute whose value you wish to send. In the To field, enter the cookie name for the cookie to receive the value.
Body Content Type Specifies the Content-Type header. All types use the UTF-8 character set. Ignore this setting for the GET method.
Body Data* Only supported for the Send Customized Data via HTTP Request Action Ignore this setting for the GET method. Provide name/value pairs if body content type is application/x-www-form-urlencoded Provide a template name for more complex payloads.
Batching Options* Record Count Maximum, between 10 and 10,000. Time To Live, in minutes, between 5 and 60 minutes.
Template Variables For more information, see Template Variables Guide.
Templates For more information, see Trimou Templates Guide. Each template requires a unique name Inject templates into any supported field by referencing its name enclosed in double curly braces Templates can be injected into URL, URL Parameters, Headers, Cookies or Body Data fields.
Batching Options Record Count Maximum, between 10 and 10,000. Time To Live, in minutes, between 5 and 60 minutes.

* Allows you to input the field value from a custom template by enclosing its name in double curly braces. For example, if your template is named some-template, the content rendered can be injected into the field by referencing {{some-template}}.

Was this page helpful?

This page was last updated: June 23, 2022