TokenStatusValidatorDecorator Class
Abblix.Oidc.Server
Abblix.Oidc.Server.Features.Tokens.Revocation
TokenStatusValidatorDecorator Class
Enhances the functionality of an existing IJsonWebTokenValidator by adding token revocation validation capabilities. This decorator checks whether the JSON Web Token (JWT) has been revoked or used before and, if so, invalidates the token. It utilizes an ITokenRegistry to check the token's status and an inner IJsonWebTokenValidator for initial token validation.
public class TokenStatusValidatorDecorator : Abblix.Jwt.IJsonWebTokenValidator
Inheritance System.Object → TokenStatusValidatorDecorator
Implements IJsonWebTokenValidator
Constructors
TokenStatusValidatorDecorator(ITokenRegistry, IJsonWebTokenValidator) Constructor
Enhances the functionality of an existing IJsonWebTokenValidator by adding token revocation validation capabilities. This decorator checks whether the JSON Web Token (JWT) has been revoked or used before and, if so, invalidates the token. It utilizes an ITokenRegistry to check the token's status and an inner IJsonWebTokenValidator for initial token validation.
public TokenStatusValidatorDecorator(Abblix.Oidc.Server.Features.Storages.ITokenRegistry tokenRegistry, Abblix.Jwt.IJsonWebTokenValidator innerValidator);
Parameters
tokenRegistry ITokenRegistry
The token registry used to check token status.
innerValidator IJsonWebTokenValidator
The inner validator for initial token validation.
Properties
TokenStatusValidatorDecorator.EncryptionAlgorithmsSupported Property
Forwards the JWE key-management algorithms accepted by the inner validator; revocation checking does not influence which encryption algorithms are supported.
public System.Collections.Generic.IEnumerable<string> EncryptionAlgorithmsSupported { get; }
Implements EncryptionAlgorithmsSupported
Property Value
System.Collections.Generic.IEnumerable<System.String>
TokenStatusValidatorDecorator.EncryptionMethodsSupported Property
Forwards the JWE content-encryption algorithms accepted by the inner validator; revocation checking does not influence which encryption algorithms are supported.
public System.Collections.Generic.IEnumerable<string> EncryptionMethodsSupported { get; }
Implements EncryptionMethodsSupported
Property Value
System.Collections.Generic.IEnumerable<System.String>
TokenStatusValidatorDecorator.SigningAlgorithmsSupported Property
Forwards the set of JWS signing algorithms accepted by the inner validator (RFC 7518 §3.1
names such as RS256, PS256, ES256); revocation checking does not
influence which algorithms are supported.
public System.Collections.Generic.IEnumerable<string> SigningAlgorithmsSupported { get; }
Implements SigningAlgorithmsSupported
Property Value
System.Collections.Generic.IEnumerable<System.String>
Methods
TokenStatusValidatorDecorator.ValidateAsync(string, ValidationParameters) Method
Validates a JSON Web Token (JWT) and checks its revocation status.
public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Jwt.JsonWebToken,Abblix.Jwt.JwtValidationError>> ValidateAsync(string jwt, Abblix.Jwt.ValidationParameters parameters);
Parameters
jwt System.String
The JWT to be validated.
parameters ValidationParameters
Validation parameters to use during validation.
Implements ValidateAsync(string, ValidationParameters)
Returns
System.Threading.Tasks.Task<Abblix.Utils.Result<JsonWebToken,JwtValidationError>>
A Result containing either a validated JsonWebToken or a JwtValidationError.
If the token is revoked or already used, it returns a JwtValidationError.
Otherwise, it returns the result from the inner validator.