Class TokenValidators
java.lang.Object
io.fluxzero.idp.client.TokenValidators
ServiceLoader-backed token validator selector.
Fluxzero applications should call this facade rather than constructing a concrete
validator directly. That keeps the application authentication code stable while the runtime chooses
the correct trust source from the classpath. In production this normally means
JwksTokenValidator; in local development tests it can mean the local stub IDP validator.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<TokenValidator> Loads available validators from the current classpath.static JwtClaimsvalidate(TokenValidationRequest request) Validates a token with the first supporting validator that accepts it.
-
Method Details
-
validate
Validates a token with the first supporting validator that accepts it.Validators are tried in descending
TokenValidator.priority()order. A validator that reports support but rejects the token does not stop the search, which allows a more specific test validator and the generic JWKS validator to coexist. If none accepts the token, the last validation failure is retained as the cause for easier diagnosis.- Parameters:
request- token validation parameters- Returns:
- normalized claims from a trusted token
-
loadValidators
Loads available validators from the current classpath.- Returns:
- immutable validators sorted by descending priority
-