MfaSecondFactor
Struct Stable
The different ways in which a user pool can obtain their MFA token for sign in.
| Source | aws-cognito/lib/user-pool.ts |
|---|---|
| Type last changed |
Example
python
cognito.UserPool(self, "myuserpool",
# ...
mfa=cognito.Mfa.REQUIRED,
mfa_second_factor=cognito.MfaSecondFactor(
sms=True,
otp=True,
email=False
)
)
java
UserPool.Builder.create(this, "myuserpool")
// ...
.mfa(Mfa.REQUIRED)
.mfaSecondFactor(MfaSecondFactor.builder()
.sms(true)
.otp(true)
.email(false)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new UserPool(this, "myuserpool", new UserPoolProps {
// ...
Mfa = Mfa.REQUIRED,
MfaSecondFactor = new MfaSecondFactor {
Sms = true,
Otp = true,
Email = false
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
cognito.NewUserPool(this, jsii.String("myuserpool"), &UserPoolProps{
// ...
Mfa: cognito.Mfa_REQUIRED,
MfaSecondFactor: &MfaSecondFactor{
Sms: jsii.Boolean(true),
Otp: jsii.Boolean(true),
Email: jsii.Boolean(false),
},
})
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
The MFA token is a time-based one time password that is generated by a hardware or software token.
The MFA token is sent to the user via SMS to their verified phone numbers.