APIKey Filter validates API Keys present in HTTP headers. The list of authorized API Keys is defined directly in a Secret.
If an incoming request does not have the header specified by the
APIKey Filter or it does not contain one of the key values
configured by the
Filter then the request is denied.
See the API Key Filter API reference for an overview of all the supported fields.
Come up with an API Key value to use. For this example, we're going to use the string
Convert the API Key value to base64.
You can do this however you prefer, such as with an online tool like base64encode.org or with the terminal:
Create an APIKey Filter with the encoded API Key from above:
Create a FilterPolicy resource to use the
Send a request with the APIKey header
Send a request with the APIKey header and value.