Customized response message and status code in custom Lambda authorizer #1816
-
In our API Gateway, we are using a custom Lambda authorizer for authentication requests. The Lambda authorizer currently supports responses such as "Allow" and "Deny," which correspond to standard HTTP status codes like 401 (Unauthorized) and 403 (Forbidden). However, we have a specific scenario where we need to return a 406 (Not Acceptable) response code for certain conditions, but Lambda authorizers seem to restrict us to only using 401 or 403 status codes for authentication failures. Questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @kkarthik-1, As per Amazon API Gateway documentation, Lambda authorizers in API Gateway are limited to returning only 401 (Unauthorized) or 403 (Forbidden) status codes. It does not allow you to return custom HTTP status codes other than the standard 401 and 403 codes. Regards, |
Beta Was this translation helpful? Give feedback.
Hi @kkarthik-1,
As per Amazon API Gateway documentation, Lambda authorizers in API Gateway are limited to returning only 401 (Unauthorized) or 403 (Forbidden) status codes. It does not allow you to return custom HTTP status codes other than the standard 401 and 403 codes.
Regards,
Chaitanya