1
votes

I'm using a custom authenticator (Lambda) to validate Javascript Web Tokens (JWT) for a backend Node.js API on Amazon's API Gateway.

Is there a way to pass the policy generated from Lambda to the backend API through a header? The JWTs contain some information that I want the API backend to access, without having to re-validate the tokens.

1

1 Answers

0
votes

Update: You can use the principalId as mentioned in the docs

You can access the principalId value in a mapping template using the $context.authorizer.principalId variable. This is useful if you want to pass the value to the back end. For more information, see Accessing the $context Variable.