OAuth authentication
OAuth authentication follows the two-step token pattern but has its own standards. This page covers the client_credentials grant type, a common OAuth flow used for system-to-system authentication.
In a typical OAuth client_credentials flow:
- The adapter sends a
client_id,client_secret, andgrant_typein the initial token request. The request body is usually URL-encoded. - The external system returns a bearer token in the
access_tokenfield of the response. - Subsequent requests include this token, prefixed with
Bearer, in theAuthorizationheader.
Configure the service instance configuration
Update the authentication section of theItential Platform service instance configuration for the adapter inItential Platform Admin Essentials with the following properties:
- Set
client_idto the client ID provided by the external system. - Set
client_secretto the client secret provided by the external system. - Set
grant_typeto"client_credentials". - Set
auth_fieldto"header.headers.Authorization"— the location of the token on all subsequent requests. - Set
auth_field_formatto"Bearer {token}"— the format of the token on all subsequent requests.
Configure the endpoint configuration
The endpoint configuration is located at /adapter-home-dir/entities/.system. If OAuth support has already been contributed back to the adapter repository, these changes may already be in place.
If you are using an open-source adapter and make OAuth changes, consider contributing them back to the adapter repository.
action.json
The token request for OAuth uses URLENCODE as the requestDatatype. This causes the adapter library to URL-encode the request body before sending it, producing a payload like:
The request and response schemas can be named differently from the defaults, but the values in action.json must be relative paths to existing files in the endpoint configuration.
Request schema
The request schema (oAuthTokenRequest.json) adds grant_type, client_secret, and client_id to the token request body. Although these values are defined in the service instance configuration, Adapter Builder does not add them to the schema automatically.
Response schema
The response schema (oAuthTokenResponse.json) maps the access_token field in the response to token for use by the adapter.