Skip to content
v2.275.0

MfaSecondFactor Struct ​

The different ways in which a user pool can obtain their MFA token for sign in.

Example ​

ts
new cognito.UserPool(this, 'myuserpool', {
  // ...
  mfa: cognito.Mfa.REQUIRED,
  mfaSecondFactor: {
    sms: true,
    otp: true,
    email: false, // email-based MFA
  },
});

Properties ​

emailoptionalbooleanemailoptionalboolemailoptionalBooleanEmailoptionalboolEmailoptional*bool= false#
The MFA token is sent to the user via EMAIL.

To enable email-based MFA, set email property to the Amazon SES email-sending configuration and set feturePlan to FeaturePlan.ESSENTIALS or FeaturePlan.PLUS

otpbooleanotpboolotpBooleanOtpboolOtp*bool= falserequired#
The MFA token is a time-based one time password that is generated by a hardware or software token.
smsbooleansmsboolsmsBooleanSmsboolSms*bool= truerequired#
The MFA token is sent to the user via SMS to their verified phone numbers.