#### [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')

## ITokenRegistry Interface

Represents a registry that manages the statuses of JSON Web Tokens \(JWTs\)\. This registry allows for tracking
and updating the status of tokens, such as marking them as used or revoked\.

```csharp
public interface ITokenRegistry
```

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

## ITokenRegistry\.GetStatusAsync\(string\) Method {#Abblix.Oidc.Server.Features.Storages.ITokenRegistry.GetStatusAsync(string)}

Asynchronously retrieves the current status of a specified JWT identifier\.

```csharp
System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus> GetStatusAsync(string jwtId);
```
#### Parameters

###### `jwtId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.ITokenRegistry.GetStatusAsync(string).jwtId}

The identifier of the JWT whose status is to be queried\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[JsonWebTokenStatus](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.JsonWebTokenStatus')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns the [JsonWebTokenStatus](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.JsonWebTokenStatus') of the JWT
            \(e\.g\., active, revoked\)\.

## ITokenRegistry\.SetStatusAsync\(string, JsonWebTokenStatus, DateTimeOffset\) Method {#Abblix.Oidc.Server.Features.Storages.ITokenRegistry.SetStatusAsync(string,Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus,System.DateTimeOffset)}

Asynchronously sets the status for a specified JWT identifier\. This operation may be used to mark a token
as used or revoked\.

```csharp
System.Threading.Tasks.Task SetStatusAsync(string jwtId, Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus status, System.DateTimeOffset expiresAt);
```
#### Parameters

###### `jwtId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.ITokenRegistry.SetStatusAsync(string,Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus,System.DateTimeOffset).jwtId}

The identifier of the JWT whose status is to be updated\.

###### `status` [JsonWebTokenStatus](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.JsonWebTokenStatus') {#Abblix.Oidc.Server.Features.Storages.ITokenRegistry.SetStatusAsync(string,Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus,System.DateTimeOffset).status}

The new status to be assigned to the JWT, such as [Used](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus#Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus.Used 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.JsonWebTokenStatus\.Used') or
            [Revoked](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus#Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus.Revoked 'Abblix\.Oidc\.Server\.Features\.Tokens\.Revocation\.JsonWebTokenStatus\.Revoked')\.

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

The expiration time of the JWT\. This is used to determine if the status should be
            updated based on the token's validity\.

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')  
A task representing the asynchronous operation of updating the token's status\.
