Class: AWSCDK::Cognito::AllowedFirstAuthFactors

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cognito/allowed_first_auth_factors.rb

Overview

The types of authentication that you want to allow for users' first authentication prompt.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(password:, email_otp: nil, passkey: nil, sms_otp: nil) ⇒ AllowedFirstAuthFactors

Returns a new instance of AllowedFirstAuthFactors.

Parameters:

  • password (Boolean)

    Whether the password authentication is allowed.

  • email_otp (Boolean, nil) (defaults to: nil)

    Whether the email message one-time password is allowed.

  • passkey (Boolean, nil) (defaults to: nil)

    Whether the Passkey (WebAuthn) is allowed.

  • sms_otp (Boolean, nil) (defaults to: nil)

    Whether the SMS message one-time password is allowed.



13
14
15
16
17
18
19
20
21
22
# File 'cognito/allowed_first_auth_factors.rb', line 13

def initialize(password:, email_otp: nil, passkey: nil, sms_otp: nil)
  @password = password
  Jsii::Type.check_type(@password, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "password")
  @email_otp = email_otp
  Jsii::Type.check_type(@email_otp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "emailOtp") unless @email_otp.nil?
  @passkey = passkey
  Jsii::Type.check_type(@passkey, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "passkey") unless @passkey.nil?
  @sms_otp = sms_otp
  Jsii::Type.check_type(@sms_otp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "smsOtp") unless @sms_otp.nil?
end

Instance Attribute Details

#email_otpBoolean? (readonly)

Note:

Default: false

Whether the email message one-time password is allowed.

Returns:

  • (Boolean, nil)


34
35
36
# File 'cognito/allowed_first_auth_factors.rb', line 34

def email_otp
  @email_otp
end

#passkeyBoolean? (readonly)

Note:

Default: false

Whether the Passkey (WebAuthn) is allowed.

Returns:

  • (Boolean, nil)


39
40
41
# File 'cognito/allowed_first_auth_factors.rb', line 39

def passkey
  @passkey
end

#passwordBoolean (readonly)

Whether the password authentication is allowed.

This must be true.

Returns:

  • (Boolean)


29
30
31
# File 'cognito/allowed_first_auth_factors.rb', line 29

def password
  @password
end

#sms_otpBoolean? (readonly)

Note:

Default: false

Whether the SMS message one-time password is allowed.

Returns:

  • (Boolean, nil)


44
45
46
# File 'cognito/allowed_first_auth_factors.rb', line 44

def sms_otp
  @sms_otp
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
53
# File 'cognito/allowed_first_auth_factors.rb', line 46

def self.jsii_properties
  {
    :password => "password",
    :email_otp => "emailOtp",
    :passkey => "passkey",
    :sms_otp => "smsOtp",
  }
end

Instance Method Details

#to_jsiiObject



55
56
57
58
59
60
61
62
63
64
# File 'cognito/allowed_first_auth_factors.rb', line 55

def to_jsii
  result = {}
  result.merge!({
    "password" => @password,
    "emailOtp" => @email_otp,
    "passkey" => @passkey,
    "smsOtp" => @sms_otp,
  })
  result.compact
end