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.

没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则