Skip to content

SecurityEventTokenValidatorExtensions Class

The consumer-facing entry into validation: one call that runs a compact token through a validator and shapes the outcome into the result a consumer acts on. Defined over the interface rather than a class of its own, because after composition the resolved ISecurityEventTokenValidator IS the whole profile - there is no separate driver to name, hold or inject.

C#
public static class SecurityEventTokenValidatorExtensions

Inheritance System.Object → SecurityEventTokenValidatorExtensions

Methods

SecurityEventTokenValidatorExtensions.ValidateAsync(this ISecurityEventTokenValidator, string, SecurityEventTokenValidationOptions, CancellationToken) Method

Validates a token.

C#
public static System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken,Abblix.SecurityEvents.Validation.SecurityEventTokenValidationError>> ValidateAsync(this Abblix.SecurityEvents.Validation.ISecurityEventTokenValidator validator, string compactToken, Abblix.SecurityEvents.Validation.SecurityEventTokenValidationOptions options, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

validator ISecurityEventTokenValidator

The validation profile - typically the composed pipeline.

compactToken System.String

The token as received, in compact serialization.

options SecurityEventTokenValidationOptions

What this run expects of the token.

cancellationToken System.Threading.CancellationToken

Cancels I/O the validators perform, such as key retrieval.

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<ValidatedSecurityEventToken,SecurityEventTokenValidationError>>
The validated token with its typed payloads, or the first error a validator reported.

Exceptions

System.InvalidOperationException
Every check passed but none produced a validated token. A profile that removes the signature step must still set the context's token from a validator of its own - the exception is what keeps that omission from surfacing as a null to the consumer.