Configuration values for PreInput field
| PreInputs Values | Acceptable Values | Description |
|---|---|---|
defaultTtl | - Data type: Integer - Range: 1 - Infinite | 1. This is a required value. 2. Provide the cache TTL for the access token. If the 3. No default value. |
clientId | Data type: String | 1. This is a conditionally required value. 2. Provide the An exception is thrown if 3. No default value. |
readTimeout | - Data type: Integer - Range: 1 - Infinite | 1. This is a required value. 2. Provide the The 3. No default value. |
connectTimeout | - Data type: Integer - Range: 1 - Infinite | 1. This is a required value. 2. Provide the 3. No default value. |
tokenClientCredentialsLocation | Data Type: String | 1. This is an optional value. 2. The default value is header, and the other option is body. Any other string will give an exception. Note: For the body, 3. For the header, |
clientSecret | Data Type: String | 1. This is a conditionally required value. 2. Provide the 3. An exception is thrown if grant_type is |
tokenRequestURI | Data Type: String | 1. This is a required value. 2. Provide the complete URI to hit the token request. 3. No default value. |
grantType | - Data Type: String - Allowed values: | 1. This is an optional value. 2. Provide the 3. The default value is |
tokenType | - Data Type: String - Allowed value: Bearer | 1. This is an optional value. 2. If this value is not provided, then this value defaults to Bearer. |
passwordIncludeClientCredentials | Data Type: Boolean | 1. This is a conditionally required value. 2. Set value to 3. Set value to 3. The default is false. |
username | Default Type: String | 1. This is a conditionally required value. 2. Provide the username in the area encrypted value. An exception will be thrown if the password |
password | Data Type: String | 1. This is a conditionally required value. 2. Provide the password in the area encrypted value. An exception will be thrown if the password |
Generating Area-encrypted Values using Java or PHP
Some PreInputs 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 adapter 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 PreInputs 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 PreInputs field. -
Repeat this step for each of
clientId,clientSecret,username, andpassword.
Example configurations
The following examples show how to configure the PreInputs 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.
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