#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.Storages](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages 'Abblix\.Oidc\.Server\.Features\.Storages')

## IRevocationCutoffRegistry Interface

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

```csharp
public interface IRevocationCutoffRegistry
```

Derived  
↳ [RevocationCutoffRegistry](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.RevocationCutoffRegistry 'Abblix\.Oidc\.Server\.Features\.Storages\.RevocationCutoffRegistry')

### Remarks
Kept apart from [ITokenRegistry](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.ITokenRegistry 'Abblix\.Oidc\.Server\.Features\.Storages\.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 {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.GetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.Threading.CancellationToken)}

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

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.RevocationScope') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.GetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.Threading.CancellationToken).scope}

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

###### `principal` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.GetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.Threading.CancellationToken).principal}

The subject identifier or the session identifier\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.GetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.Threading.CancellationToken).cancellationToken}

Cancels the lookup\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Nullable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
The moment before which tokens for this principal are revoked\.

## IRevocationCutoffRegistry\.SetCutoffAsync\(RevocationScope, string, DateTimeOffset, DateTimeOffset, CancellationToken\) Method {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken)}

Records a cutoff for a principal\.

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.RevocationScope') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken).scope}

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

###### `principal` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken).principal}

The subject identifier or the session identifier\.

###### `cutoff` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken).cutoff}

The moment before which tokens for this principal are revoked\.

###### `expiresAt` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken).expiresAt}

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

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry.SetCutoffAsync(Abblix.Oidc.Server.Features.Tokens.Revocation.RevocationScope,string,System.DateTimeOffset,System.DateTimeOffset,System.Threading.CancellationToken).cancellationToken}

Cancels the write\.

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')  
A task that completes once the cutoff has been written\.
