From API Gateway, I created a custom authorizer for my API using Lambda function in python. API Gateway hands over the incoming auth token using a header I configure(method.request.header.Authorization
). However I also need the other headers of the original http request inside my lambda function. How do I access them? I did not see the headers on event
object input to my lambda function.
Note that this is not a duplicate of How to access HTTP headers for request to AWS API Gateway using Lambda?. The question is about custom authorizer lambda function. I do not see any configuration option to pass the incoming http headers to authorizer lambda function.
As per AWS Documentation, API Gateway calls Custom Authorizer with below input. Base on the the below, I assume my ask is not possible. But want to check if there is a workaround.
{ "type":"TOKEN", "authorizationToken":"", "methodArn":"arn:aws:execute-api:<regionId>:<accountId>:<apiId>/<stage>/<method>/<resourcePath>" }