Class JwtValidator<T>

java.lang.Object
io.micronaut.security.token.jwt.validator.JwtValidator<T>
Type Parameters:
T - Request

public final class JwtValidator<T> extends Object
A builder style class for validating JWT tokens against any number of provided encryption or signature configurations and any claim validators.
Since:
1.4.0
Author:
James Kleeh
  • Method Details

    • validate

      public Optional<com.nimbusds.jwt.JWT> validate(String token, @Nullable T request)
      Validates the supplied token with any configurations and claim validators present.
      Parameters:
      token - The JWT string
      request - HTTP Request
      Returns:
      An optional JWT token if validation succeeds
    • validate

      public Optional<com.nimbusds.jwt.JWT> validate(@NonNull @NonNull com.nimbusds.jwt.JWT token, @Nullable T request)
      Validates the supplied token with any configurations and claim validators present.
      Parameters:
      token - The JWT token
      request - The HTTP Request which contained the JWT token
      Returns:
      An optional JWT token if validation succeeds
    • builder

      public static JwtValidator.Builder builder()
      Returns:
      A new JWT validator builder