- Newest
- Most votes
- Most comments
Hello, the reason why you are not able to use 'context.authorizer.principalId' in Integration Response is because this value is limited to the request and is not present in the response sent back by the HTTP backend. This context variable maps the principal user identification associated with the token sent by the client and returned from an API Gateway Lambda authorizer (formerly known as a custom authorizer) [1].
To map this value in your header (here: foo), we can send this header to your HTTP backend and return as a response from there. Use mapping template to map this header to send to the backend HTTP API.[2]
[1] https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference
[2] https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-method-settings-execution-console.html
Relevant content
- asked 9 months ago
