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?

Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions