Api Gateway with AWS_IAM authorizer | 403 Forbidden

0

I have an OCR service hosted in the below setup
API Gateway -> Lambda

I have enabled AWS_IAM Authorization on API Gateway, and for input data like JSON it's working as expected
However, when I choose to enable binary media types and try to upload Image to the same setup

The request is denied with status code 403 and error message as,
{"message": "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details ...[TRUNCATED]"}

I do know that within API Gateway, there is the conversion of Headers and request body for binary inputs, which I believe is the main cause for this issue.
But this must be a standard setup and I must be missing something here.
Appreciate your help.

Update: this is not working only from POSTMAN, It works seamlessly via python requests and AWS4Auth

1개 답변
1

This sounds like a problem in: X-Amz-Signature. I suggest you review the following documentation:

https://docs.aws.amazon.com/general/latest/gr/signature-v4-troubleshooting.html#signature-v4-troubleshooting-canonical-errors

profile picture
전문가
답변함 2년 전

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

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

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