Any advice on how should I go about debugging 401s...
# help
a
Any advice on how should I go about debugging 401s / 403s with regards to Auth and Api constructs?
f
Hey @Ashishkumar Pandey, the API response header has a bit more details. I recall seeing an AWS help doc with different reasons for a 401/403. Couldn’t find it just now. Will share if I come across it again.
U can also try logging more stuff in access log (ie. authorizer error) https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
The is the default access log format https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/src/util/apiGatewayV2AccessLog.ts#L13-L31 It doesn’t log the authorizer error. ie.
$context.authorizer.error