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

## TokenRevoker Class

Records a revocation as a cutoff against the principal, which is one write however many tokens it
invalidates\.

```csharp
public class TokenRevoker : Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → TokenRevoker

Implements [ITokenRevoker](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.ITokenRevoker')
### Constructors

## TokenRevoker\(ILogger\<TokenRevoker\>, IRevocationCutoffRegistry, IOptions\<OidcOptions\>, TimeProvider\) Constructor {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.TokenRevoker(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker_,Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,System.TimeProvider)}

Records a revocation as a cutoff against the principal, which is one write however many tokens it
invalidates\.

```csharp
public TokenRevoker(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker> logger, Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry cutoffRegistry, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options, System.TimeProvider clock);
```
#### Parameters

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1')[TokenRevoker](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.TokenRevoker')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.TokenRevoker(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker_,Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,System.TimeProvider).logger}

Records each cutoff written, which is the only trace a revocation leaves\.

###### `cutoffRegistry` [IRevocationCutoffRegistry](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry 'Abblix\.Oidc\.Server\.Features\.Storages\.IRevocationCutoffRegistry') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.TokenRevoker(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker_,Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,System.TimeProvider).cutoffRegistry}

Where the cutoff is kept\.

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.TokenRevoker(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker_,Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,System.TimeProvider).options}

Supplies how long a cutoff is retained\.

###### `clock` [System\.TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider 'System\.TimeProvider') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.TokenRevoker(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker_,Abblix.Oidc.Server.Features.Storages.IRevocationCutoffRegistry,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_,System.TimeProvider).clock}

Supplies the current moment when the caller names none\.
### Methods

## TokenRevoker\.RevokeSessionAsync\(string, Nullable\<DateTimeOffset\>, CancellationToken\) Method {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSessionAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken)}

Cuts one session off at [before](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSessionAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).before 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.TokenRevoker\.RevokeSessionAsync\(string, System\.Nullable\<System\.DateTimeOffset\>, System\.Threading\.CancellationToken\)\.before'), leaving the same user's other sessions alone\.

```csharp
public System.Threading.Tasks.Task RevokeSessionAsync(string sessionId, System.Nullable<System.DateTimeOffset> before=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `sessionId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSessionAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).sessionId}

The session identifier the tokens carry\.

###### `before` [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') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSessionAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).before}

The moment to revoke up to; the current time when omitted\.

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

Cancels the write\.

Implements [RevokeSessionAsync\(string, Nullable&lt;DateTimeOffset&gt;, CancellationToken\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker#Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker.RevokeSessionAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken) 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.ITokenRevoker\.RevokeSessionAsync\(string, System\.Nullable\<System\.DateTimeOffset\>, System\.Threading\.CancellationToken\)')

#### 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 revocation is recorded\.

### Remarks
The session stops being reusable as well as its tokens stopping, so this ends that sign\-in for the
purposes of this server\. It does not clear the cookie carrying it \- that belongs to whoever holds the
browser, and this call is made by somebody else\.

## TokenRevoker\.RevokeSubjectAsync\(string, Nullable\<DateTimeOffset\>, CancellationToken\) Method {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSubjectAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken)}

Cuts this subject off at [before](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSubjectAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).before 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.TokenRevoker\.RevokeSubjectAsync\(string, System\.Nullable\<System\.DateTimeOffset\>, System\.Threading\.CancellationToken\)\.before'), across every session they hold\.

```csharp
public System.Threading.Tasks.Task RevokeSubjectAsync(string subject, System.Nullable<System.DateTimeOffset> before=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `subject` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSubjectAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).subject}

The subject identifier the tokens carry\.

###### `before` [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') {#Abblix.Oidc.Server.Features.Tokens.Revocation.TokenRevoker.RevokeSubjectAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken).before}

The moment to cut off at; the current time when omitted\. Tokens issued at or
            after it are unaffected, so the user signing in again works with nothing to undo\.

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

Cancels the write\.

Implements [RevokeSubjectAsync\(string, Nullable&lt;DateTimeOffset&gt;, CancellationToken\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker#Abblix.Oidc.Server.Features.Tokens.Revocation.ITokenRevoker.RevokeSubjectAsync(string,System.Nullable_System.DateTimeOffset_,System.Threading.CancellationToken) 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.ITokenRevoker\.RevokeSubjectAsync\(string, System\.Nullable\<System\.DateTimeOffset\>, System\.Threading\.CancellationToken\)')

#### 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 revocation is recorded\.

### Remarks
Two things stop\. Every token issued to them earlier is refused on its next use, and every browser
session authenticated earlier stops being reusable, so the authorization endpoint will not mint a
replacement against one\. Signing in again works immediately and leaves nothing to clean up: the new
session is later than the cutoff and passes\. Its tokens follow once
[RevocationCutoffSkew](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions#Abblix.Oidc.Server.Common.Configuration.OidcOptions.RevocationCutoffSkew 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions\.RevocationCutoffSkew') has elapsed, since inside that
window a freshly minted token cannot be told from one whose clock ran ahead\.
