Cloud API Management OAuth2 Backend Authentication Custom Policy Configuration Values
Configuration Values
The scope parameter is supported only in Boomi Cloud API Management – Local Edition 6.3.0 and later. It is not supported in Boomi Cloud API Management.
The following configuration values can be defined while configuring the Cloud API Management OAuth2 Backend Authentication Policy on the Call Transformation page:
| Field name | Type | Field Value | Required/Optional | Description |
|---|---|---|---|---|
| Processing Adapter | String | CAM_OAuth2BackendAuthentication_Service | Required | Adapter used to secure target requests using OAuth access tokens obtained from customer-provided OAuth token endpoint details. |
| Perform Pre-processing | Boolean | Enabled | Required | When enabled, the policy checks the cache for an existing access token and requests a new one from the configured token endpoint if none is found. |
| Data to make available for pre-processing (PreInput Value) | Map | — | Required | Specifies the input data made available for pre-processing. |
| Integer Range: 1 - Infinite | defaultTtl | Required |
If the | |
| String Range: 1 - Infinite | clientId | Conditionally required |
An exception is thrown if | |
| Integer Range: 1 - Infinite | readTimeout | Required |
The | |
| Integer Range: 1 - Infinite | connectTimeout | Required |
| |
| String | tokenClientCredentialsLocation | Optional |
| |
| String | clientSecret | Conditionally required |
| |
| String | tokenRequestURI | Required |
| |
| String | grantType | Optional |
| |
| String | tokenType | Optional |
| |
| Boolean | passwordIncludeClientCredentials | Conditionally required |
| |
| String | username | Conditionally required |
| |
| String | password | Conditionally required |
| |
| String (space-delimited) | scope | Optional |
| |
| Perform Post-processing | Boolean | Enabled | Required | Important: You must enable this option to perform post-processing. This is mandatorily required if pre-process is enabled. |
| Data to make available for post-processing (PostInput Value) | Map | — | Optional | Specifies the input data made available for post-processing. |
| String | clientId | Optional |
| |
| Integer Range: 1 - Infinite | readTimeout | Optional |
| |
| Integer Range: 1 - Infinite | connectTimeout | Optional |
| |
| String | introspectClientCredentialsLocation | Optional |
| |
| String | clientSecret | Optional |
| |
| String | introspectRequestURI | Optional |
|
Generating Area-encrypted Values using Java or PHP
Some PreInput Value fields, such as clientId, clientSecret, username, and password, require values encrypted using our area encryption. We provide you with a decryptedAreaKey specific to your area. Use that key to encrypt each credential before configuring the CAM_OAuth2BackendAuthentication_Service policy on the Call Transformations page.
You can encrypt your credentials using one of the following methods:
Option 1: Java
Procedure
-
Run the following Java command for each credential you want to encrypt:
java -jar area-encrypt-1.0.0.jar <decryptedAreaKey> <Data>Where:
decryptedAreaKey: The area key will be provided by us.Data: The plain-text credential (your confidential data) to encrypt (for example, your client ID).
The command returns output in the following format:
Decrypted Area Key provided: <decryptedAreaKey>
Data provided: <Data>
Encrypted Data: <encrypted-string> -
Copy the
<encrypted-string>value and paste it into the relevant PreInput Value field. -
Repeat this step for each of
clientId,clientSecret,username, andpassword.
Option 2: PHP
Procedure
-
Run the following PHP command for each credential you want to encrypt. This requires PHP with the mcrypt extension installed on your machine. :
php encrypt_key_v3.php <decryptedAreaKey> <Data>The command returns an encrypted string.
-
Copy the
<encrypted-string>value and paste it into the relevant PreInput Value field. -
Repeat this step for each of
clientId,clientSecret,username, andpassword.
Example configurations
The following examples show how to configure the PreInput Value field on the Call Transformations page. Replace the placeholder <area-encrypted> values with the encrypted strings generated in the Generating Area-encrypted Values using Java or PHP section.
Do not add the scope parameter to the examples below - "Example: client_credentials grant type" and "Example: password grant type." These examples work the same way in both Cloud API Management and Boomi Cloud API Management - Local Edition.
Example: client_credentials grant type
grantType:client_credentials
tokenRequestURI:https://auth.example.com/oauth2/token
clientId:<area-encrypted-client-id>
clientSecret:<area-encrypted-client-secret>
tokenType:Bearer
tokenClientCredentialsLocation:header
defaultTtl:3600
connectTimeout:10
readTimeout:30
Example: password grant type
grantType:password
tokenRequestURI:https://auth.example.com/oauth2/token
clientId:<area-encrypted-client-id>
clientSecret:<area-encrypted-client-secret>
username:<area-encrypted-username>
password:<area-encrypted-password>
passwordIncludeClientCredentials:true
tokenClientCredentialsLocation:header
tokenType:Bearer
defaultTtl:3600
connectTimeout:10
readTimeout:30
Configuration Steps
You can configure this policy using either of the following UIs: