pub struct TwoFactorConfig {Show 21 fields
pub allow_passwordless: bool,
pub totp_allow_passwordless: Option<bool>,
pub backup_allow_passwordless: Option<bool>,
pub backup_code_amount: f64,
pub backup_code_length: f64,
pub custom_backup_codes_generate: Option<Arc<dyn Fn() -> AuthResult<Vec<String>> + Send + Sync>>,
pub backup_storage: TwoFactorBackupStorage,
pub account_lockout: AccountLockoutConfig,
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: f64,
pub totp_issuer: Option<String>,
pub totp_disabled: bool,
pub send_otp: Option<Arc<dyn SendTwoFactorOtp>>,
pub otp_digits: f64,
pub otp_period_minutes: f64,
pub otp_allowed_attempts: f64,
pub otp_storage: TwoFactorOtpStorage,
}Expand description
Public configuration for the two-factor plugin.
Fields§
§allow_passwordless: boolAllow omission of passwords for users without a stored credential hash.
totp_allow_passwordless: Option<bool>Override the global passwordless policy for existing TOTP URI retrieval.
backup_allow_passwordless: Option<bool>Override the global passwordless policy for backup regeneration.
backup_code_amount: f64Number of generated backup codes, using JS array-length coercion.
backup_code_length: f64Generated characters per code, before the separator after character five.
custom_backup_codes_generate: Option<Arc<dyn Fn() -> AuthResult<Vec<String>> + Send + Sync>>Optional synchronous generator. Its strings are persisted unchanged.
backup_storage: TwoFactorBackupStorage§account_lockout: AccountLockoutConfig§issuer: Option<String>Override the issuer embedded in enrollment TOTP URIs.
skip_verification_on_enable: boolSkip the enrollment verification step and enable 2FA immediately.
Pending challenge lifetime in seconds, including fractions and explicit zero.
trust_device_max_age: f64Trusted proof lifetime in seconds; negative values omit cookie Max-Age.
totp_period: f64TOTP period in seconds, retaining Source fractional and signed counters.
totp_digits: f64Raw TOTP digits. Fractional values retain Source decimal-remainder output.
totp_issuer: Option<String>Issuer used when retrieving an existing authenticator URI.
totp_disabled: boolReject TOTP enrollment, URI retrieval, verification and server generation.
send_otp: Option<Arc<dyn SendTwoFactorOtp>>Optional OTP sender callback. When absent, /two-factor/send-otp is disabled.
otp_digits: f64Number of decimal digits in delivered OTPs, following JS numeric length.
otp_period_minutes: f64OTP lifetime in minutes; zero selects the pinned three-minute default.
otp_allowed_attempts: f64Failed OTP budget; zero selects the pinned five-attempt default.
otp_storage: TwoFactorOtpStorage