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?

preguntada hace un año201 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas