Class IssuedAtClaimsValidator

All Implemented Interfaces:
ClaimsValidator, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

@ThreadSafeAfterInit public class IssuedAtClaimsValidator extends AbstractClaimsValidator
If the 'iat' claim is present in the JWT, verifies it is not to far away from the current time. The message lifetime, clock skew and the claim existence requirement can be configured.
  • Field Details

    • clockSkew

      @Nonnull private Duration clockSkew
      Clock skew adjustment in both directions to consider still acceptable (Default value: 1 minute).
    • messageLifetime

      @Nonnull private Duration messageLifetime
      Amount of time for which a message is valid after it is issued (Default value: 1 minute).
    • requiredRule

      private boolean requiredRule
      Whether this rule is required to be met.
  • Constructor Details

    • IssuedAtClaimsValidator

      public IssuedAtClaimsValidator()
      Constructor.
  • Method Details

    • setMessageLifetime

      public void setMessageLifetime(@Nonnull Duration lifetime)
      Sets the amount of time for which a message is valid.
      Parameters:
      lifetime - amount of time for which a message is valid
    • setClockSkew

      public void setClockSkew(@Nonnull Duration skew)
      Set the clock skew.
      Parameters:
      skew - clock skew to set
    • setRequiredRule

      public void setRequiredRule(boolean required)
      Sets whether this rule is required to be met.
      Parameters:
      required - whether this rule is required to be met
    • doValidate

      public void doValidate(@Nonnull JWTClaimsSet claims, @Nonnull ProfileRequestContext context) throws JWTValidationException
      Perform validation of the given claims supported by the supplied context.
      Specified by:
      doValidate in class AbstractClaimsValidator
      Parameters:
      claims - the claims to validate.
      context - the profile request context.
      Throws:
      JWTValidationException - when validation is unsuccessful due to a failed attempt