Class TokenValidators

java.lang.Object
io.fluxzero.idp.client.TokenValidators

public class TokenValidators extends Object
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 Details

    • validate

      public static JwtClaims validate(TokenValidationRequest request)
      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

      public static List<TokenValidator> loadValidators()
      Loads available validators from the current classpath.
      Returns:
      immutable validators sorted by descending priority