API Key Authenticator Policy
Policy to authenticate a client using API keys in a header or query parameter
All Authentication policies require the Authorize By Role Policy policy to authorize the API caller correctly. For example, you can configure the API Key Authenticator policy to add the role admin to the client and then configure the Authorize By Role policy to authorize users with that role.
Policy execution order
The API Key Authenticator policy executes after validation policies, such as IP Restriction.
| Field/Field set | Description |
|---|---|
| When this policy should be applied | An expression that defines one or more conditions that must be
true for the policy to execute.
Default value: True Example: The expression |
| API Keys |
Required.
The API keys that a client passes in for authentication.
You can also reference a secret from a third-party secrets manager by entering an
expression. Click Note: Description, API key, and role must be unique.
|
| Description |
Required. The email of the key owner. Example: [email protected] |
| API Key |
Required. The API key, which is a long, randomly-generated string. Default value: N/A Example: 72D11F27-5719-4BE7-95BA-AF20DEBAF42D |
| Roles |
Required. The list of roles to assign clients that use this key. Default value: N/A Example: admin |
| Expiration MM-dd-yyyy |
Required. The API key expiration date in the format: MM-dd-yyyy. Default value: N/A Example: 12-31-2028 |
| Key Location |
The location to find the key. At least one header or parameter key location is required. If none of the specified locations are found, this policy passes the request through to the next policy. |
| Custom Header Keys |
The names of the headers that can contain the key. At runtime, the Snaplex checks all of
these locations. Click |
| Key |
The name of the headers that can contain keys. Default value: N/A Example: X-API-Key |
| Custom Query String Parameter Keys |
CAUTION: Because query parameters appear in logs and other locations, avoid
using them to pass sensitive information, such as keys and tokens. The names of
the query parameters that can contain keys. At runtime, the Snaplex checks all of these
locations. Click |
| Key |
Required. The name of a query parameter that contains a key. Default value: N/A Example: api-key |
| Authorization Header Type | The authorization schema for the key passed in the header. Common authorization schemas include:
Default value: |
| Description |
Required. Default value: Authenticating requests only for specified API keys Example: API key based authentication |