Class MfaStateProtector

Assembly: redb.Identity.Core.dll

Encrypts/decrypts temporary MFA state using ASP.NET DataProtection with TTL enforcement.
Same pattern as but for the MFA challenge flow.

Also implements — a minimal read-only surface in
redb.Identity.Contracts that transport facades (HTTP, gRPC, …) consume to render
MFA-method selectors without taking a project-reference on Core.

public sealed class MfaStateProtector : IMfaStateInspector

Inheritance

Object→MfaStateProtector

Implements

Methods

Protect(MfaState)

Encrypts MFA state into a base64 string for use as a hidden form field or query parameter.

public string Protect(MfaState state)

Unprotect(string, TimeSpan?)

Decrypts and validates MFA state. Returns null if invalid, tampered, or expired.

public MfaState? Unprotect(string protectedState, TimeSpan? maxAge = null)

Constructors