You can use the api-key
policy to enforce API Key checks during request processing, allowing only apps with approved API
keys to access your APIs.
This policy ensures that API Keys are valid, have not been revoked or expired and are approved to consume the specific resources associated with your API.
You can configure the following policy level options:
Property | Required | Description | Type | Default |
---|---|---|---|---|
|
- |
Propagate API Key to upstream API |
boolean |
false |
"api-key": {
"propagateApiKey": false
}
You can use the response template feature to override the default response provided by the policy. These templates must be defined at the API level (see the API Console Response Templates option in the API Proxy menu).
The error keys sent by this policy are as follows:
Key | Parameters |
---|---|
API_KEY_MISSING |
- |
API_KEY_INVALID_KEY |
- |