Search code examples
amazon-web-servicesaws-lambdaaws-api-gatewayactions-on-googlegoogle-smart-home

AWS API Gateway header for request in Authorizer


I am using AWS API Gateway for Communicating with Action on Google Console to AWS Lambda. In this scenario I am making a post call and I want to find the user in this call. I came to know that this is sent in the header. So I did the Following Steps:

  1. Created a resource and method and that's working fine data is being passed successfuly between each other.
  2. Now I want to pass the header to find the user so what I did was I use the authorizer from AWS API gateway console and then clicked on Create a authorizer.
  3. Now I am confused in this scenario I want a header and body so what should I send it has in Lambda Event Payload.
  4. Either Token or payload in case of token it's only sending the authorization part as a header.
  5. So According to my understanding In my scenario I'll be needing Request. But in request what should I add as Identity Sources for header in the console.

Solution

  • Actually for the Above Problem We need to do the Implementation in Integration request in the AWS API Console. Go to the Mapping template in Integration request.

    For Futher references use this article