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?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions