Class RedbPasswordResetTokenStore

Assembly: redb.Identity.Core.dll

N-4 (Session C): redb-backed . Singleton; resolves
through a fresh DI scope per operation (identical pattern to
PropsServerSideOtpStore / PropsSigningKeyStore) to avoid captive-scope-in-singleton.

Tokens are 32 bytes of CSPRNG, base64url-encoded (no padding). Only the peppered
SHA-256 hex of the plaintext is persisted ();
the plaintext is returned to the caller exactly once for e-mail delivery.


Verify runs inside a redb transaction + LockForUpdateAsync on the token row so
concurrent verify calls against the same jti serialize cleanly — the first
successful call flips , subsequent calls
see the flag under the lock and return with
Reason = already_consumed.

public sealed class RedbPasswordResetTokenStore : IPasswordResetTokenStore

Inheritance

Object→RedbPasswordResetTokenStore

Implements

Methods

IssueAsync(long, string, TimeSpan, CancellationToken)

Issues a new reset token. Generates a 32-byte CSPRNG secret (base64url-encoded),

public Task<PasswordResetIssueResult> IssueAsync(long userId, string callerResetUrl, TimeSpan ttl, CancellationToken ct = default)

VerifyAndConsumeAsync(Guid, string, CancellationToken)

Verifies and atomically consumes a reset token keyed by jti. On

public Task<PasswordResetVerifyResult> VerifyAndConsumeAsync(Guid jti, string token, CancellationToken ct = default)

Constructors