Class MfaSetupTokenProtector

Assembly: redb.Identity.Core.dll

Encrypts/decrypts an MFA setup token (B5). The setup token carries the candidate
secret/destination for an in-progress MFA setup so that the secret is NEVER persisted
to until the user proves possession by submitting a valid code
during confirm.
Uses ASP.NET DataProtection with a dedicated purpose so leaks across MFA-state /
MFA-secret protectors are impossible. Default TTL is 10 minutes.

public sealed class MfaSetupTokenProtector

Inheritance

Object→MfaSetupTokenProtector

Methods

Protect(MfaSetupTokenPayload)

public string Protect(MfaSetupTokenPayload payload)

Unprotect(string, TimeSpan?)

Returns the decrypted payload or null if tampered, malformed, expired, or older than

public MfaSetupTokenPayload? Unprotect(string token, TimeSpan? maxAge = null)

Constructors