I am using Custom Challenge for MFA because I wanted to use Twilio instead of AMAZON SNS. I have successfully implemented it. It works fine but When a user enters the wrong OTP code. The user session is expired. means that he has to again provide a phone number and request an OTP again. Whereas I want it to retry at least 3 times. before he needs to request another OTP. My Response verify trigger is as simple as below, is there something that we can do.
(event, context, callback) => {
if (event.request.privateChallengeParameters.answer == event.request.challengeAnswer) {
event.response.answerCorrect = true;
} else {
event.response.answerCorrect = false;
}
callback(null, event);
}
Invalid session for user
error. The code that you have inDefine Auth Challenge
when otp attempt less than 3 is not getting invoked for me... Any suggestions ? – Foy