I am able to enable SMS-based MFA for a user in AWS Cognito using the AdminSetUserMFAPreferenceRequest, but I am having trouble enabling MFA via email. Here's how I am currently enabling SMS MFA:
AdminSetUserMFAPreferenceRequest mfaRequest = new AdminSetUserMFAPreferenceRequest()
.withUserPoolId(userPoolId)
.withUsername(username)
.withSMSMfaSettings(
new SMSMfaSettingsType().withEnabled(true)
.withPreferredMfa(true)
);
This works for SMS, but I'm unsure of the correct way to enable email-based MFA. Is there a similar method to enable email MFA, or do I need to take a different approach?