Reputation: 1793
So I read this in the apigee documentation to understand how I can enforce an API validation policy . I am still confused on where this is correlating the keys with .
1) lets say I have an api key called key1
for a client . the
<VerifyAPIKey name="APIKeyValidation">
<APIKey>request.queryparameter.apikey</APIKey>
</VerifyAPIKey>
strips the api key from the request . Now my question here is how I should be correlating this key
with key1
. any pointers / help with this is greatly appreciated .
Upvotes: 0
Views: 597
Reputation: 98
Key validation in Apigee Edge is an integrated part of the platform, in the prior generation the key validation was done through an API.
The way it works follows this general flow
The VerifyAPIKey policy is configured to consume the key from part of the request, this can be a form param, header or query param.
<VerifyAPIKey name="APIKeyValidation"> <APIKey>request.queryparameter.apikey</APIKey> </VerifyAPIKey>
Here are some documentation pages that talk about these policies and how they work http://apigee.com/docs/api-services/content/enforce-access-control-using-verifyapikey http://apigee.com/docs/api-services/content/exception-handling-raisefault
Upvotes: 0
Reputation: 131
You don't need to explicitly 'correlate' the API key. The policy actually validates the key for you. (In fact, sometimes you'll want to strip the API key using another policy--AssignMessage--after the key has been validated.)
The variable in the policy, 'request.queryparameter.apikey', just tells the API proxy where to look for the API key in the request message. Once it has located the key, it does the validation, and throws an exception if the key is not valid.
You can check out this sample for more:
https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/apikey
Hope that helps.
Upvotes: 1