Class SessionTicketService

Assembly: redb.Identity.Http.dll

Encrypts/decrypts session tickets using ASP.NET DataProtection.
A session ticket is a compact encrypted blob containing the user ID, session ID, and username.
Cookie-based: self-contained, no DB lookup on every request (except revocation check).

public sealed class SessionTicketService

Inheritance

Object→SessionTicketService

Methods

Protect(long, long, string)

Creates an encrypted session ticket for the given user and session.

public string Protect(long userId, long sessionId, string username)

ProtectConsent(ConsentTicket)

Mints a signed consent ticket. The authorization server issues it (after it has

public string ProtectConsent(ConsentTicket ticket)

ProtectReauth(long)

Signs a re-authentication marker capturing WHICH session was active when the OP forced

public string ProtectReauth(long markedSessionId)

Unprotect(string, TimeSpan)

Decrypts a session ticket. Returns null if the ticket is invalid, tampered, or expired.

public SessionTicket? Unprotect(string ticket, TimeSpan maxAge)

UnprotectConsent(string, TimeSpan)

Verifies and decodes a consent ticket produced by .

public ConsentTicket? UnprotectConsent(string ticket, TimeSpan maxAge)

UnprotectReauth(string, TimeSpan)

Verifies and decodes a re-authentication marker produced by .

public ReauthMarker? UnprotectReauth(string marker, TimeSpan maxAge)

Constructors