TokenRegistry Class
Abblix.Oidc.Server
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.
public class TokenRegistry : Abblix.Oidc.Server.Features.Storages.ITokenRegistry
Inheritance System.Object → TokenRegistry
Implements ITokenRegistry
Constructors
TokenRegistry(IEntityStorage, IEntityStorageKeyFactory) Constructor
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.
public TokenRegistry(Abblix.Oidc.Server.Features.Storages.IEntityStorage storage, Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory keyFactory);
Parameters
storage IEntityStorage
The storage mechanism that will handle the persistence of token statuses.
keyFactory IEntityStorageKeyFactory
The factory for generating standardized storage keys.
Methods
TokenRegistry.GetStatusAsync(string) Method
Retrieves the current status of a JWT by its identifier.
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus> GetStatusAsync(string jwtId);
Parameters
jwtId System.String
The identifier of the JWT whose status is being queried.
Implements GetStatusAsync(string)
Returns
System.Threading.Tasks.Task<JsonWebTokenStatus>
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
Sets or updates the status of a JWT by its identifier, with an expiration on the status entry.
public System.Threading.Tasks.Task SetStatusAsync(string jwtId, Abblix.Oidc.Server.Features.Tokens.Revocation.JsonWebTokenStatus status, System.DateTimeOffset expiresAt);
Parameters
jwtId System.String
The identifier of the JWT whose status is being set.
status JsonWebTokenStatus
The status to assign to the JWT.
expiresAt System.DateTimeOffset
The time at which the status record should expire.
Implements SetStatusAsync(string, JsonWebTokenStatus, DateTimeOffset)
Returns
System.Threading.Tasks.Task
A task representing the asynchronous operation of setting the token's status.