Secure a Custom Activity Using an OAuth 2.0 Bearer Token
Marketing Cloud Engagement supports the use of OAuth 2.0 bearer tokens in calls to external services. By using OAuth 2.0 bearer tokens, you can increase the security of requests that come into and out of Marketing Cloud Engagement.
To use OAuth 2.0 to secure your requests to external services, you must first configure Marketing Cloud Engagement to obtain bearer tokens from your token exchange endpoint. After you configure Marketing Cloud Engagement to obtain these tokens, it automatically uses them in the request headers for requests that you make to external applications.
-
In Setup, under Data Management, click Key Management.
-
Click Create.
-
For Key Type, choose Security Context.
-
For Name, enter a name for the key.
-
For External Key, enter your external key. The value that you enter can only contain ASCII characters.
-
Under Grant Type, complete these steps.
-
Select JWT Bearer.
-
For Token Endpoint, enter the URL of the token exchange endpoint.
-
For Issuer, enter the JWT issuer name to use in the token exchange.
-
For Audience, enter the JWT audience name to use in the token exchange.
-
For Subject, enter the JWT subject to use in the token exchange.
-
For Private Key, enter your RSA private key in PEM format.
-
For Valid Service URLs, enter the endpoint URLs that you plan to issue requests to.
When you configure a custom activity to use this security context, requests issued from custom journey activities to the endpoints listed in this field automatically include the bearer token in their header sections.
-
-
Save the key.
After you configure Marketing Cloud Engagement to perform token exchanges, you can create or update journeys to use OAuth 2.0 authentication. In your custom activity, add a securityOptions
object. The object must contain this information. (Substitute <externalKeyName>
for the name that you provided when you configured the key exchange.)