- Newest
- Most votes
- Most comments
To allow users to switch from Email MFA to TOTP after signup, you'll need to implement a custom flow. Here is how:
-
Keep Email MFA as default - Users sign up and get email MFA by default https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa.html
-
Implement MFA Change Flow: Use the SetUserMFAPreference API to change MFA type API Reference: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserMFAPreference.html
-
Associate TOTP with user - Use AssociateSoftwareToken API https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AssociateSoftwareToken.html
-
Verify TOTP setup - Use VerifySoftwareToken API https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerifySoftwareToken.html
-
Set TOTP as preferred MFA - Use SetUserMFAPreference API again
-
Implementing Custom Authentication Flow: You may need to customize the authentication flow to accommodate this change Guide: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html
Make sure you're following best practices for MFA changes https://docs.aws.amazon.com/cognito/latest/developerguide/managing-security.html
SDK Documentation: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-sdk.html
Remember, this approach requires custom development on your part. You'll need to create a user interface for initiating and managing the MFA change process, handle potential errors, and ensure a smooth user experience throughout the transition.
This is actually the intended functionality, though it's not immediately apparent from the configuration options. When Email MFA is enabled in Cognito, the system automatically enforces it as the default and only MFA method, bypassing the MFA selection screen entirely. This is part of Cognito's design, where email MFA is treated as a required verification method rather than an optional MFA choice.
If you need to provide MFA options to your users, here are the recommended approaches:
- For multiple MFA choices: Disable Email MFA Enable only SMS and/or TOTP (authenticator app) as MFA options
2.Recommended configuration: Implement email verification during the sign-up process Configure SMS/TOTP as MFA options This provides both email verification and MFA flexibility https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa.html
Got it. Thx Rumaisa. Some users like the email MFA, but some still want to use TOTP. Is it possible to keep the email MFA as the default way, but provide a way for users to change the MFA to TOTP after they sign up?
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 3 months ago

Thx Rumaisa! This is really helpful