pub struct TwoFactorConfig {Show 16 fields
pub allow_passwordless: bool,
pub totp_disabled: bool,
pub totp_allow_passwordless: Option<bool>,
pub otp_digits: usize,
pub otp_period: Duration,
pub otp_allowed_attempts: usize,
pub otp_storage: TwoFactorOtpStorage,
pub backup_code_options: BackupCodeOptions,
pub account_lockout: AccountLockout,
pub issuer: Option<String>,
pub skip_verification_on_enable: bool,
pub two_factor_cookie_max_age: f64,
pub trust_device_max_age: f64,
pub totp_period: f64,
pub totp_digits: usize,
pub send_otp: Option<Arc<dyn SendTwoFactorOtp>>,
}Expand description
Public configuration for the two-factor plugin.
Fields§
§allow_passwordless: boolPermit passwordless management only when the user has no credential password.
totp_disabled: boolDisable TOTP enrollment, verification and generation.
totp_allow_passwordless: Option<bool>Override passwordless policy for reading the TOTP URI.
otp_digits: usizeNumber of decimal digits in delivered OTPs.
otp_period: DurationDelivered OTP lifetime. Zero uses the upstream three-minute default.
otp_allowed_attempts: usizeFailed OTP attempts before the next request consumes the exhausted code. Zero means five.
otp_storage: TwoFactorOtpStorageStored OTP representation.
backup_code_options: BackupCodeOptionsBackup-code generation, storage and passwordless policy.
account_lockout: AccountLockoutAccount-level protection shared by all sign-in factors and challenges.
issuer: Option<String>Override the issuer embedded in generated TOTP URIs.
skip_verification_on_enable: boolSkip the enrollment verification step and enable 2FA immediately.
Pending two-factor cookie lifetime in seconds, including fractions. Zero is preserved.
trust_device_max_age: f64Trusted-device cookie lifetime in seconds, including fractions. Zero is preserved.
totp_period: f64TOTP period in fractional seconds. Enrollment URIs preserve the configured value. Generation, verification, and URI retrieval use 30 seconds for zero or NaN.
totp_digits: usizeTOTP digit count.
send_otp: Option<Arc<dyn SendTwoFactorOtp>>Optional OTP sender callback. When absent, /two-factor/send-otp is disabled.