Get request body from custom lambda authorizer

0

I have a HTTP API gateway with a custom lambda authorizer. I need to get the request body to determine whether or not to authorize the request but currently I am only getting the request headers. Is there any way I can do this?

Amazon Q said that the lambda authorizer will receive the entire request object as a parameter however this has not been the case.

1개 답변
0

According to the documentation you are correct. Only the headers/parameters are passed into the Authorizer which would make sense as during a POST you wouldn’t be sending a body as such and would only be interested in variables.

You would usually pass through a bearer token as such which would check to see if you have valid credentials and allow or deny you. You still need another authentication process to obtain a token to supply to api gateway.

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html

profile picture
전문가
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠