add custom header at aws lambda authorizer

16 Views Asked by At

my server is built on aws cloud infra. And I want to check the jwt token in the lambda authorizer based on node.js via api gateway when the client sends the request, and if the token is valid, I would like to decode the token to add the same value as the user's id to the client's request header. So far, the authorized part in lambda authorizer has been successful. Also, I added event.heads["userId"] = userId; to lambda, but the spring server in my vpc link is not receiving the corresponding header. What should I do?

client -> api gateway -> lambda authorizer(authorize and add userId header) -> my vpc-link server

I have tried various things, such as creating an integrated request mapping template, but it does not work as I want. Also, when I create a mapping template, the request does not reach the spring server when I send the request, and I get an error response from apigateway as follows: {"message": "internal server error" }

0

There are 0 best solutions below