Skip to content

Cognito - New users MFA being defaulted to SMS.

0

Our organisation has recently realised that our new customers are being defaulted to using SMS MFA and not being provided the option to using Email or app based MFA.

This is how we are creating the new users. Is it due to the email verified field?

        var newUserRequest = new AdminCreateUserRequest
        {
            UserPoolId = _poolId,
            DesiredDeliveryMediums = user.DesiredDeliveryMediums,
            Username = user.Email,
            UserAttributes = new List<AttributeType>
            {
                new AttributeType() { Name = "name", Value = user.Name },
                new AttributeType() { Name = "email", Value = user.Email },
                new AttributeType() { Name = "email_verified", Value = user.EmailVerified.ToString() }
            }
        };

MFA Settings

asked 2 years ago275 views

1 Answer
0

Yes, it is like you think. Ensure that email_verified is set to "true" and include DesiredDeliveryMediums with both "EMAIL" and "SMS" if you'd like to allow email-based MFA during user creation.

EXPERT

answered 2 years ago

  • Thanks for the suggestion.

    Tried that but then I get the error User could not have been created. Please check user details. No phone_number provided but desired delivery medium was SMS

    I'm not looking to change the delivery of the welcome message. I just want to allow users to select the MFA they desire.

    • It has been previously working for the past 2 year. Just the other day we realised this isn't the case anymore without any changes to our cognito systems.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.