1 Answer
- Newest
- Most votes
- Most comments
0
I am not sure what exactly you are trying to do. If you select Token, how can you authorize both the API Key and the JWT? If you place the API Key in the Authorization header, where is the JWT token?
If you need to verify 2 headers you should use the Request payload type. The IdentitySource is used for caching in this case. You do not need to specify both of them if they will not always be provided in the request.
What do you mean by: "map the API Key to its ID"? The value returned from the Lambda Authorizer should be the API Key as known to API Gateway so that it can use it for throttling, etc. The API Key ID, is just an internal identifier that should not mean anything to the backend.
Relevant content
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Thanks Uri.
Currently, we are using Token for Lambda Authorizer. If the API call is made by an End User, a JWT Token 'Bearer xxxx' will be put to Authorization header. If the API call is made by a Server, a Basic Token 'Basic xxxx' will be put to Authorization header. And the value of the Basic Token will be the encoded API Key with its ID.
If we use Request for Lambda Authorizer. It will become if the API call is made by an End User with a JWT Token 'Bearer xxx', the token will be put to Authorization header. If the API call is made by a Server, the API Key will be put at x-api-key header. So it's alway one and only one of the two headers will present in the request. How should we select the Identity resource?
The API Key ID is helping us to do the association with UsagePlans from backend.