Skip to content

IRevocationCutoffRegistry Interface

Stores the moment before which every token issued to a principal is treated as revoked.

C#
public interface IRevocationCutoffRegistry

Derived
RevocationCutoffRegistry

Remarks

Kept apart from ITokenRegistry because the two answer different questions. That one records the fate of a token that already exists, one entry per token; this one records a fact about a principal, which the token is measured against. A cutoff is therefore one write however many tokens it invalidates, and it needs no cleanup when the user signs in again: the tokens minted afterwards carry a later iat and pass on their own.

A boolean would not do. A subject outlives any single sign-in, so a flag saying "revoked" would keep refusing the tokens of every later session too.

Methods

IRevocationCutoffRegistry.GetCutoffAsync(RevocationScope, string, CancellationToken) Method

The cutoff recorded for a principal, or null when none is.

C#
System.Threading.Tasks.Task<System.Nullable<System.DateTimeOffset>> GetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope scope, string principal, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

scope RevocationScope

Whether the principal is an end user or a single session.

principal System.String

The subject identifier or the session identifier.

cancellationToken System.Threading.CancellationToken

Cancels the lookup.

Returns

System.Threading.Tasks.Task<System.Nullable<System.DateTimeOffset>>
The moment before which tokens for this principal are revoked.

IRevocationCutoffRegistry.SetCutoffAsync(RevocationScope, string, DateTimeOffset, DateTimeOffset, CancellationToken) Method

Records a cutoff for a principal.

C#
System.Threading.Tasks.Task SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope scope, string principal, System.DateTimeOffset cutoff, System.DateTimeOffset expiresAt, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

scope RevocationScope

Whether the principal is an end user or a single session.

principal System.String

The subject identifier or the session identifier.

cutoff System.DateTimeOffset

The moment before which tokens for this principal are revoked.

expiresAt System.DateTimeOffset

When the record may be dropped, which is when the longest-lived token it could refuse has expired anyway.

cancellationToken System.Threading.CancellationToken

Cancels the write.

Returns

System.Threading.Tasks.Task
A task that completes once the cutoff has been written.