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

## TokenRegistry Class

Manages the registration and tracking of JSON Web Token \(JWT\) statuses within a persistent storage\.
This class is responsible for determining the current status of JWTs, such as whether they are active,
revoked, or expired, and updating these statuses as necessary\.

```csharp
public class TokenRegistry : Abblix.Oidc.Server.Features.Storages.ITokenRegistry
```

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

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

## TokenRegistry\(IEntityStorage, IEntityStorageKeyFactory\) Constructor {#Abblix.Oidc.Server.Features.Storages.TokenRegistry.TokenRegistry(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory)}

Manages the registration and tracking of JSON Web Token \(JWT\) statuses within a persistent storage\.
This class is responsible for determining the current status of JWTs, such as whether they are active,
revoked, or expired, and updating these statuses as necessary\.

```csharp
public TokenRegistry(Abblix.Oidc.Server.Features.Storages.IEntityStorage storage, Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory keyFactory);
```
#### Parameters

###### `storage` [IEntityStorage](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IEntityStorage 'Abblix\.Oidc\.Server\.Features\.Storages\.IEntityStorage') {#Abblix.Oidc.Server.Features.Storages.TokenRegistry.TokenRegistry(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).storage}

The storage mechanism that will handle the persistence of token statuses\.

###### `keyFactory` [IEntityStorageKeyFactory](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory 'Abblix\.Oidc\.Server\.Features\.Storages\.IEntityStorageKeyFactory') {#Abblix.Oidc.Server.Features.Storages.TokenRegistry.TokenRegistry(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).keyFactory}

The factory for generating standardized storage keys\.
### Methods

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

Retrieves the current status of a JWT by its identifier\.

```csharp
public 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.TokenRegistry.GetStatusAsync(string).jwtId}

The identifier of the JWT whose status is being queried\.

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

#### 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 resolves to the status of the JWT if found; otherwise, a default status indicating
            the token does not exist in the registry\.

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

Sets or updates the status of a JWT by its identifier, with an expiration on the status entry\.

```csharp
public 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.TokenRegistry.SetStatusAsync(string,Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus,System.DateTimeOffset).jwtId}

The identifier of the JWT whose status is being set\.

###### `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.TokenRegistry.SetStatusAsync(string,Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus,System.DateTimeOffset).status}

The status to assign to the JWT\.

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

The time at which the status record should expire\.

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

#### 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 setting the token's status\.
