Class JwtValidator


  • @Immutable
    public final class JwtValidator
    extends java.lang.Object
    Defines how the headers and claims of a JWT should be validated.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JwtValidator.Builder
      Builder for JwtValidator
    • Method Detail

      • newBuilder

        public static JwtValidator.Builder newBuilder()
        Returns a new JwtValidator.Builder.

        By default, the JwtValidator requires that a token has a valid expiration claim, no issuer and no audience claim. This can be changed using the expect...(), ignore...() and allowMissingExpiration() methods.

        If present, the JwtValidator also validates the not-before claim. The validation time can be changed using the setClock() method.

      • toString

        public java.lang.String toString()
        Returns a brief description of a JwtValidator object. The exact details of the representation are unspecified and subject to change.
        Overrides:
        toString in class java.lang.Object