I am researching AWS Cognito by building a demo. Now I can set user MFA preference to enable SMS and / or TOTP, and set one of them as preferred MFA type. Then, when next time user authenticate, user will be challenged with SMS or TOTP verification code according to the preferred MFA type.
My question is, what if user want to switch MFA type after initial password authentication but before MFA response? For example, user may have TOTP on another device other than his phone. User set SMS as preferred MFA type but realized, after sending password and being challenged to provide SMS verification code, that he didn't have his phone around but the TOTP device is available. How can the user switch to TOTP at this moment? Or, if user preference is TOTP but he want to switch to SMS at the same circumstance? What API to call?
I cannot find an API method to call from the documents. Maybe this can only be achieved through lambda triggers? In my opinion this is a rather common situation and should be provided with an example / API method.
Best regards,
Bing