On this page: Learn how to configure OAuth 2.0 authentication for custom channels in Adobe Journey Optimizer, including the token request payload, credential paths, token extraction, and token location in delivery requests.
When you select OAuth 2.0 as the authentication type while creating a custom channel, configure the token request that Adobe Journey Optimizer uses to retrieve an access token from your authorization server.
Journey Optimizer sends the token request using the endpoint, method, request, and policy configuration. It then extracts the access token from the response using tokenPath and adds it to the delivery request using locationConfig.
The OAuth 2.0 authentication payload configures the request to the token endpoint. It is separate from the message payload sent to your custom channel delivery endpoint.
Configure the token request token-request
Use the following examples to configure your token request. Replace the example endpoint and credential values with those required by your authorization server. The headers and queryParams entries in the examples are optional: remove them if your token endpoint does not require them, and remove the matching entries from credentialPaths.
Form body example form-body-example
Use a form payload when the token endpoint expects form fields such as grant_type, client_id, or client_secret.
{
"type": "oauth2",
"endpoint": {
"uri": "https://auth.example.com/oauth/token"
},
"method": "post",
"request": {
"headers": [
{
"key": "sampleHeaderKey",
"value": "sampleHeaderValue"
}
],
"queryParams": [
{
"key": "sampleQueryParamKey",
"value": "sampleQueryParamValue"
}
],
"payload": {
"type": "form",
"content": [
{
"key": "grant_type",
"value": "client_credentials"
},
{
"key": "client_id",
"value": "your-client-id"
},
{
"key": "client_secret",
"value": "your-client-secret"
}
],
"includeNullValues": false
}
},
"response": {
"type": "json"
},
"policy": {
"timeoutInMilliseconds": 30000,
"cache": {
"enabled": true,
"ttlInSeconds": 300
},
"retry": {
"enabled": false,
"maxRetryCount": 3
}
},
"credentialPaths": [
"header.sampleHeaderKey",
"queryParam.sampleQueryParamKey",
"payload.client_id",
"payload.client_secret"
],
"tokenPath": "access_token",
"locationConfig": {
"key": "Authorization",
"location": "header"
}
}
For a form payload, each credential path uses the form field key, for example, payload.client_secret. Do not include content or array indexes in the credential path.
JSON body example json-body-example
Use a json payload when the token endpoint expects a JSON request body.
{
"type": "oauth2",
"endpoint": {
"uri": "https://auth.example.com/oauth/token"
},
"method": "post",
"request": {
"headers": [
{
"key": "sampleHeaderKey",
"value": "sampleHeaderValue"
}
],
"queryParams": [
{
"key": "sampleQueryParamKey",
"value": "sampleQueryParamValue"
}
],
"payload": {
"type": "json",
"content": {
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-client-secret"
},
"includeNullValues": false
}
},
"response": {
"type": "json"
},
"policy": {
"timeoutInMilliseconds": 30000,
"cache": {
"enabled": true,
"ttlInSeconds": 300
},
"retry": {
"enabled": false,
"maxRetryCount": 3
}
},
"credentialPaths": [
"header.sampleHeaderKey",
"queryParam.sampleQueryParamKey",
"payload.client_id",
"payload.client_secret"
],
"tokenPath": "access_token",
"locationConfig": {
"key": "Authorization",
"location": "header"
}
}
OAuth 2.0 fields oauth2-fields
typeoauth2.endpoint.urimethodpost for token requests.request.headersrequest.queryParamsrequest.payloadform and json payloads.request.payload.includeNullValuesresponse.typejson when the token endpoint returns a JSON response.policy.timeoutInMillisecondspolicy.cachepolicy.retrycredentialPathstokenPathaccess_token or data.access_token.locationConfiglocationConfig.keyAuthorization.locationConfig.locationheader or queryParam.When token caching is enabled, Journey Optimizer reuses the OAuth token for the configured cache duration instead of calling the token endpoint for every delivery request.
Identify credential fields credential-paths
Use credentialPaths to identify which request fields contain credentials. If a header or query parameter contains a credential, include its path as well as any credential paths in the request body. The examples above identify the sample header and query parameter values as credentials; adjust this list to match your request.
header.header.sampleHeaderKeyqueryParam.queryParam.sampleQueryParamKeypayload.payload.client_secretApply the following rules:
- Paths must start with
header,queryParam, orpayloadand use dots as separators. - For
formpayloads, usepayload.<formFieldKey>. - For
jsonpayloads, use the JSON object path, such aspayload.client_idorpayload.credentials.client_secret. Do not includecontentin the path. - Empty path segments are not supported. For example,
payload..client_idis invalid.
For a nested JSON body, use dot notation as shown in this configuration excerpt:
{
"request": {
"payload": {
"type": "json",
"content": {
"credentials": {
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
},
"includeNullValues": false
}
},
"credentialPaths": [
"payload.credentials.client_id",
"payload.credentials.client_secret"
]
}
Extract the access token token-path
tokenPath defines where the access token is located in the OAuth 2.0 token response.
For the following response, set tokenPath to access_token:
{
"access_token": "example-access-token",
"token_type": "Bearer",
"expires_in": 3600
}
For a nested response, set tokenPath to data.access_token:
{
"data": {
"access_token": "example-access-token"
}
}
Add the token to delivery requests token-location
locationConfig defines where Journey Optimizer adds the retrieved token when calling the custom channel delivery endpoint.
To send the token in the Authorization header, use:
{
"locationConfig": {
"key": "Authorization",
"location": "header"
}
}
headerqueryParamLimits and validation rules limits
endpoint.uripolicy.timeoutInMillisecondspolicy.cache.ttlInSecondsrequest.headersrequest.queryParamsrequest.payload.type=formtokenPathcredentialPathsheader, queryParam, or payload and use dots as separators.Next steps next-steps
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: Configure OAuth 2.0 authentication for a custom channel by defining the token endpoint request, identifying credential fields, extracting the access token from the response, and specifying where to add it to delivery requests.
Intents:
- Configure OAuth 2.0 authentication when creating a custom channel or managing API credentials
- Choose a form or JSON body for the token endpoint request
- Identify credential fields in headers, query parameters, and request bodies
- Extract an access token from a top-level or nested response field
- Add the retrieved token to a delivery request header or query parameter
- Understand token caching and authentication configuration limits
Glossary:
- Token endpoint: The authorization server endpoint that Journey Optimizer calls to retrieve an access token
- Authentication payload: The configuration of the OAuth 2.0 token request, separate from the message payload sent to the delivery endpoint (product-specific)
- Credential paths: The paths identifying request fields that contain credentials, configured through
credentialPaths(product-specific) - Token path: The dot-separated path to the access token in the token endpoint response, configured through
tokenPath(product-specific) - Token location configuration: The delivery request header or query parameter to which the retrieved token is added, configured through
locationConfig(product-specific)
Guardrails:
- Set the authentication configuration
typetooauth2and usepostfor token requests. - The token endpoint must be an absolute HTTPS URL with a non-empty host and a maximum length of 2048 characters.
- Token request bodies support
formandjsonpayloads; choose the format expected by your authorization server. - Credential paths must start with
header,queryParam, orpayload, use dots as separators, and contain no empty path segments. - Form credential paths use the form field key. JSON credential paths use the JSON object path. Do not include
contentor form array indexes in credential paths. - Supported token locations are
headerandqueryParam. - The token endpoint timeout must be between 300 and 60000 milliseconds.
- When token caching is enabled, the cache duration must be between 300 and 3600 seconds. Journey Optimizer reuses the token for the configured duration instead of retrieving a token for every delivery request.
- Credential values must contain between 1 and 1024 characters.
- An empty
tokenPathis allowed only when the entire response is the token.
Terminology:
- Canonical name: OAuth 2.0 authentication - variants: OAuth 2.0 authentication payload, OAuth token request configuration
- Do not confuse: “authentication payload” (configuration for retrieving an access token) with “message payload” (content sent to the custom channel delivery endpoint)
- Do not confuse:
credentialPaths(credential fields in the token request) withtokenPath(access token field in the token response) - Do not confuse:
request.headersandrequest.queryParams(values sent to the token endpoint) withlocationConfig(where the retrieved token is added to delivery requests)
FAQ:
- Q: When should I use a form or JSON payload? - Use
formwhen the token endpoint expects form fields, andjsonwhen it expects a JSON request body. - Q: How do I identify a client secret in a form body? - Use the form field key, for example,
payload.client_secret, withoutcontentor an array index. - Q: How do I identify credentials in a nested JSON body? - Use dot notation, for example,
payload.credentials.client_secret. - Q: How do I extract a token from a nested response? - Set
tokenPathto the response field path, for example,data.access_token. - Q: Where can Journey Optimizer add the token to delivery requests? - Set
locationConfig.locationtoheaderorqueryParamandlocationConfig.keyto the header or query parameter name. - Q: Does Journey Optimizer retrieve a token for every delivery request? - When caching is enabled, it reuses the token for the configured cache duration.