Class PropsWebAuthnChallengeStore

Assembly: redb.Identity.Core.dll

MFA-3: PROPS-backed mirroring
. Singleton; resolves
through a fresh DI scope per operation to avoid captive-scope-in-singleton.

Anti-replay strategy: lookup-then-insert under transaction. The first
with a given challenge writes a
row; subsequent calls find the row and
return . The lookup-then-insert is run in a
transaction; if the underlying store were to allow concurrent inserts of the same
hash, we'd still have last-writer-wins on the row but both completes would proceed —
to make this race-tight, the calling code (e.g. WebAuthnMfaMethod.CompleteAssert)
is expected to run inside its own outer transaction with LockForUpdateAsync on
the user's row, so two concurrent ceremonies for the same user
serialize on that lock before reaching here. Cross-user replay is ruled out by the
UserId check in WebAuthnMfaMethod — if attacker submits user A's challenge
against user B's account, the cross-check fails before we get here.

public sealed class PropsWebAuthnChallengeStore : IWebAuthnChallengeStore

Inheritance

Object→PropsWebAuthnChallengeStore

Implements

Methods

ConsumeAsync(byte[], long, string, TimeSpan, CancellationToken)

Atomically marks a challenge as consumed by the given user for the given operation.

public Task<WebAuthnConsumeResult> ConsumeAsync(byte[] challenge, long userId, string operation, TimeSpan ttl, CancellationToken ct = default)

Constructors