how can we set dynamically message for api gateway responses for 401 statuscode through custom authorizer lambda

0

I'm implementing the custom authorizer lambda for that I have some specific requirement that is as cognito user pool authorizer how it will send when the token has expired with 401 statuscode and 'Unauthorized' message in the same way I am trying to do through the custom authorizer lambda but it is not working properly. Im able to do with policy document with 'effect: Deny' in the context we can send the message that we want we can access that also but in the 401 case why it is not possible? Can we modify the API Gateway responses as we want the statusCode and body? why because I'm able to get the expired token case also I'm getting 401 by modifying in the gateway response statuscode.

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions