REST API in API Gateway returns 403 when resource or method is incorrect

1

API Gateway gives 403 error when called with wrong method or resource.

This is basically wrong. The correct error should be 404 for resource not found, or 405 when method is invalid.

Gateway Response doesn't help in this case. I already tried changing MISSING_AUTHENTICATION_TOKEN gateway response. And it only works when there is no Authorization token provided in the request.

If you provide Authorization token and then call the wrong resource or a valid resource with wrong method, you will get 403 with error like {token} not a valid key=value pair (missing equal-sign) in Authorization header: Bearer {token}

AWS should provide a gateway response configuration for when resource or method is invalid irrespective of the authorization token

  • Could you give us more information about the REST API? Is it private? How are you implementing the API for you to get that error?

已提问 1 年前201 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则