Class JwtValidator
Validates EdDSA (Ed25519) JWTs against the service JWKS. The BCL has no Ed25519, so signatures are verified with NSec. JWKS is fetched on demand and cached, refreshed on a key-id miss (key rotation). Claims (iss/aud/exp/nbf/sub/username/scope) are read with a reflection-free DOM.
public sealed class JwtValidator
- Inheritance
-
JwtValidator
- Inherited Members
Constructors
JwtValidator(ServiceHttpClient, AuthConfig)
Validates EdDSA (Ed25519) JWTs against the service JWKS. The BCL has no Ed25519, so signatures are verified with NSec. JWKS is fetched on demand and cached, refreshed on a key-id miss (key rotation). Claims (iss/aud/exp/nbf/sub/username/scope) are read with a reflection-free DOM.
public JwtValidator(ServiceHttpClient http, AuthConfig config)
Parameters
httpServiceHttpClientconfigAuthConfig
Methods
ValidateAsync(string, string?, CancellationToken)
Validate an identity token; throws on any failure, returns the claims on success.
public Task<JwtClaims> ValidateAsync(string token, string? expectedAudience = null, CancellationToken ct = default)
Parameters
tokenstringexpectedAudiencestringctCancellationToken