Class JwtIssuedAtValidator

java.lang.Object
org.springframework.security.oauth2.jwt.JwtIssuedAtValidator
All Implemented Interfaces:
OAuth2TokenValidator<Jwt>

public final class JwtIssuedAtValidator extends Object implements OAuth2TokenValidator<Jwt>
An OAuth2TokenValidator responsible for validating the "iat" claim in the Jwt.
Since:
6.5
See Also:
  • Constructor Details

    • JwtIssuedAtValidator

      public JwtIssuedAtValidator()
      Constructs a JwtIssuedAtValidator with the defaults.
    • JwtIssuedAtValidator

      public JwtIssuedAtValidator(boolean required)
      Constructs a JwtIssuedAtValidator using the provided parameters.
      Parameters:
      required - true if the "iat" claim is REQUIRED in the Jwt, false otherwise
  • Method Details

    • validate

      public OAuth2TokenValidatorResult validate(Jwt jwt)
      Description copied from interface: OAuth2TokenValidator
      Verify the validity and/or constraints of the provided OAuth 2.0 Token.
      Specified by:
      validate in interface OAuth2TokenValidator<Jwt>
      Parameters:
      jwt - an OAuth 2.0 token
      Returns:
      OAuth2TokenValidationResult the success or failure detail of the validation
    • setClockSkew

      public void setClockSkew(Duration clockSkew)
      Sets the clock skew. The default is 60 seconds.
      Parameters:
      clockSkew - the clock skew
    • setClock

      public void setClock(Clock clock)
      Sets the Clock used in Instant.now(Clock).
      Parameters:
      clock - the clock