Authenticates a client by calling out to a REST service to validate a token found in the request and then getting information about the user. Use this policy as an alternative to the other authentication methods.
Policy Execution Order
This Policy will be executed The Callout Authenticator policy executes after early stage request validation policies, like IP Restriction.
All Authentication policies require the Authorize By Role policy to authenticate the API caller correctly. For example, you can configure this policy to add the role “admin” to the client and then configure the Authorize By Role policy to authorize users with that role.
|Multiexcerpt include macro|
|Parameter Name||Description||Default Value||Example|
|Label||Required. The name for the API policy.||Callout Authenticator||My_Auth|
When this policy should be applied
An expression enabled field that determines the condition to be fulfilled for the API policy to execute.
For example, if the value in this field is request.method == "POST", the API policy is executed only if the request method is a POST.
|N/A||request.method == "POST"|
Extract into $token
Required. Specifies the location to find the key in the request. If one of the given locations is not found, this API policy will pass the request through to the next API policy.
Custom Header Keys
The names of the headers that can contain the key. If more than one header is given, they will all be checked. Click + to add more custom header keys.
|Key||The name of the custom header key.||N/A||X-Token|
Custom Query String Parameters
The names of the query parameters that can contain the key. If more than one name is given, they will all be checked. Click + to add more custom query string parameters.
|Key||The name of the custom query string parameter.||N/A||token|
Authorization Header Type
If the key is in the Authorization header, this value is used as the “type” to check.
Callout Request #1-2
Required. These sections describe the HTTP GET requests this API policy should make to validate the token and get information about a user.
The location to store the result of the request in the working object, as a JSON-Path.
The destination for the request.
The query parameters to add into the URL. Click + to add more query parameters.
The headers to include in the request. Click + to add more headers.
Specifies how the request's response must be handled.
Extract User Info
Required. Specifies how to extract information about the user from the working object.
User ID Expression
An expression that returns a string to be used as the user ID.
An expression that returns the list of roles this user is in.
|N/A||$user.groups.map(group => group.name)|
Time-To-Live in Seconds
Required. The number of seconds for which the token is valid for before it is re-validated.
|600 (10 minutes)||700|
|Status||Specifies whether the API policy is enabled or disabled.||Enabled||Disabled|