Class: AWSCDK::Cognito::MfaSecondFactor
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Cognito::MfaSecondFactor
- Defined in:
- cognito/mfa_second_factor.rb
Overview
The different ways in which a user pool can obtain their MFA token for sign in.
Instance Attribute Summary collapse
-
#email ⇒ Boolean?
readonly
The MFA token is sent to the user via EMAIL.
-
#otp ⇒ Boolean
readonly
The MFA token is a time-based one time password that is generated by a hardware or software token.
-
#sms ⇒ Boolean
readonly
The MFA token is sent to the user via SMS to their verified phone numbers.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(otp:, sms:, email: nil) ⇒ MfaSecondFactor
constructor
A new instance of MfaSecondFactor.
- #to_jsii ⇒ Object
Constructor Details
#initialize(otp:, sms:, email: nil) ⇒ MfaSecondFactor
Returns a new instance of MfaSecondFactor.
12 13 14 15 16 17 18 19 |
# File 'cognito/mfa_second_factor.rb', line 12 def initialize(otp:, sms:, email: nil) @otp = otp Jsii::Type.check_type(@otp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "otp") @sms = sms Jsii::Type.check_type(@sms, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "sms") @email = email Jsii::Type.check_type(@email, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "email") unless @email.nil? end |
Instance Attribute Details
#email ⇒ Boolean? (readonly)
Default: 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 feture_plan to FeaturePlan.ESSENTIALS or FeaturePlan.PLUS
41 42 43 |
# File 'cognito/mfa_second_factor.rb', line 41 def email @email end |
#otp ⇒ Boolean (readonly)
Default: false
The MFA token is a time-based one time password that is generated by a hardware or software token.
26 27 28 |
# File 'cognito/mfa_second_factor.rb', line 26 def otp @otp end |
#sms ⇒ Boolean (readonly)
Default: true
The MFA token is sent to the user via SMS to their verified phone numbers.
32 33 34 |
# File 'cognito/mfa_second_factor.rb', line 32 def sms @sms end |
Class Method Details
.jsii_properties ⇒ Object
43 44 45 46 47 48 49 |
# File 'cognito/mfa_second_factor.rb', line 43 def self.jsii_properties { :otp => "otp", :sms => "sms", :email => "email", } end |
Instance Method Details
#to_jsii ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'cognito/mfa_second_factor.rb', line 51 def to_jsii result = {} result.merge!({ "otp" => @otp, "sms" => @sms, "email" => @email, }) result.compact end |