Class FederationStateProtector

Assembly: redb.Identity.Core.dll

Encrypts/decrypts federation state parameters using ASP.NET DataProtection.
State carries the provider id, return URL, OIDC nonce, PKCE code verifier,
issuance timestamp, a unique jti for one-time-use enforcement (C6),
and an optional browser-binding hash (C6).

public sealed class FederationStateProtector

Inheritance

Object→FederationStateProtector

Methods

ComputeBindingHash(string)

Computes the browser-binding hash that should be stored inside the state blob

public static string ComputeBindingHash(string secret)

Protect(FederationState)

Encrypts federation state into a base64-safe string. Sets IssuedAt to

public string Protect(FederationState state)

Unprotect(string, TimeSpan?)

Legacy synchronous overload. Decrypts and validates TTL only. Does NOT consult

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

UnprotectAsync(string, string?, CancellationToken)

Full C6 validation path: decrypt, TTL check, browser-binding (if present in state),

public Task<(FederationState? State, FederationStateValidationFailure Failure)> UnprotectAsync(string protectedState, string? bindingSecret, CancellationToken ct = default)

Constructors