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?