Interface IMfaMethod

Assembly: redb.Identity.Core.dll

SPI for MFA verification methods (TOTP, SMS, WebAuthn, etc.).
Implementations are stateless — they receive directly
and never load/save data. Orchestration is done by .

public interface IMfaMethod

Properties

MethodId

Unique method identifier (e.g. "totp", "sms", "email").

string MethodId { get; }

Methods

ConfirmAndApplyAsync(MfaProps, MfaSetupInitiation, string, MfaState?, CancellationToken)

Verifies the user-supplied code against the candidate setup data and, on success,

Task<bool> ConfirmAndApplyAsync(MfaProps props, MfaSetupInitiation initiation, string code, MfaState? state = null, CancellationToken ct = default)

InitiateSetupAsync(string, string?, CancellationToken)

Pure setup: generates the candidate secret/destination and the client-facing payload

Task<MfaSetupInitiation> InitiateSetupAsync(string username, string? destination = null, CancellationToken ct = default)

VerifyAsync(MfaProps, string, MfaState?, CancellationToken)

Verify code during login.

Task<bool> VerifyAsync(MfaProps props, string code, MfaState? state = null, CancellationToken ct = default)