Two-step token authentication
Two-step token authentication
Two-step token authentication is one of the most common API authentication methods. The adapter sends credentials in an initial request and receives a token, which it then uses in all subsequent requests.
In standard two-step token authentication:
- A username and password are sent in the body of an initial token request.
- The external system authenticates the credentials and returns a token in the response body.
- The token is placed in a header field on all subsequent requests.
Configure the service instance configuration
Two-step token authentication requires changes in two places: theItential Platform service instance configuration and the adapter’s endpoint configuration in the .system entity. This section covers the service instance configuration.
The relevant properties are in the authentication section of theItential Platform service instance configuration for the adapter, accessible throughItential Platform Admin Essentials. For a full description of all authentication properties, see Service instance configuration.
Example
Configure the endpoint configuration
The endpoint configuration for the adapter is located at /adapter-home-dir/entities/.system. This directory contains the action.json file and the request and response schema files that define how the adapter acquires a token.
action.json
The action.json file tells the adapter library how to make the token request.
Request schema
The request schema (schemaTokenReq.json) defines the data sent in the token request. Most fields should remain unchanged. The fields most commonly modified are:
You can also add client_id, client_secret, and grant_type fields following the same pattern as username and password. Additional static fields with default values can also be added to send fixed data with every token request.
Response schema
The response schema (schemaTokenResp.json) defines the data extracted from the token response. Most fields should remain unchanged. The fields most commonly modified are:
Variations
Two-step token has many variations. The following table describes common options and how to configure them.
Example: token in a custom header with URL-encoded request and SSO server
Service instance configuration
action.json