Class MfaProps
PROPS entity storing MFA configuration and secrets for a user.
Key = userId (_users._id). Separate from UserProps: different concern (security vs profile),
loaded only during login + MFA setup (not on every request).
[RedbScheme("identity.mfa")]
public class MfaProps
Inheritance
Properties
ArchivedRecoveryCodes
Archive of recovery-code batches that were retired (e.g. when MFA was disabled or
public List<MfaArchivedRecoveryCodeBatch>? ArchivedRecoveryCodes { get; set; }
DefaultMethod
Default MFA method ID ("totp"). Used when multiple methods available.
public string? DefaultMethod { get; set; }
EmailConfirmed
Whether Email OTP has been confirmed (user entered first valid code).
public bool EmailConfirmed { get; set; }
FailedAttempts
Consecutive failed MFA verification attempts (for lockout).
public int FailedAttempts { get; set; }
LastOtpSentAt
Timestamp of last OTP send (for cooldown enforcement).
public DateTimeOffset? LastOtpSentAt { get; set; }
LastTotpStep
Last accepted TOTP time-step (Unix-seconds / 30) — RFC 6238 §5.2 replay protection.
public long? LastTotpStep { get; set; }
LastVerifiedAt
Timestamp of last successful MFA verification.
public DateTimeOffset? LastVerifiedAt { get; set; }
LockedUntil
Account locked until this time after too many failed attempts. Null if not locked.
public DateTimeOffset? LockedUntil { get; set; }
OtpEmail
Email address for OTP delivery (may differ from profile email). Null if not configured.
public string? OtpEmail { get; set; }
RecentOtpTimestamps
Sliding-window record of recent OTP send timestamps (Unix seconds).
public List<long>? RecentOtpTimestamps { get; set; }
RecoveryCodes
SHA256-hashed recovery codes. Each code is one-time use.
public List<string>? RecoveryCodes { get; set; }
RecoveryCodesPepperId
Id of the pepper were hashed with
public string? RecoveryCodesPepperId { get; set; }
SmsConfirmed
Whether SMS OTP has been confirmed (user entered first valid code).
public bool SmsConfirmed { get; set; }
SmsPhone
Phone number for SMS OTP (E.164 format, e.g. "+79991234567"). Null if SMS not configured.
public string? SmsPhone { get; set; }
TotpConfirmed
Whether TOTP has been confirmed (user entered first valid code after setup).
public bool TotpConfirmed { get; set; }
UserId
The owning user's _users._id — unique per scheme via [RedbUnique]
public long? UserId { get; set; }
WebAuthnCredentials
WebAuthn credentials keyed by base64url credential ID.
public Dictionary<string, WebAuthnCredential>? WebAuthnCredentials { get; set; }