Class AudienceJwtClaimsValidator<T>

java.lang.Object
io.micronaut.security.token.jwt.validator.AudienceJwtClaimsValidator<T>
Type Parameters:
T - Request
All Implemented Interfaces:
GenericJwtClaimsValidator<T>, JwtClaimsValidator<T>

@Singleton @Requires(property="micronaut.security.token.jwt.claims-validators.audience") public class AudienceJwtClaimsValidator<T> extends Object implements GenericJwtClaimsValidator<T>
Validates JWT audience claim contains a configured value.
Since:
2.4.0
Author:
Jason Schindler, Sergio del Amo
  • Constructor Details

    • AudienceJwtClaimsValidator

      public AudienceJwtClaimsValidator(JwtClaimsValidatorConfiguration jwtClaimsValidatorConfiguration)
      Parameters:
      jwtClaimsValidatorConfiguration - JWT Claims Validator Configuration
  • Method Details

    • validate

      protected boolean validate(com.nimbusds.jwt.JWTClaimsSet claimsSet)
      Parameters:
      claimsSet - JWT Claims
      Returns:
      True if the JWT audience claim contains the expected value
    • validate

      public boolean validate(@NonNull @NonNull Claims claims, @Nullable T request)
      Specified by:
      validate in interface JwtClaimsValidator<T>
      Parameters:
      claims - JWT Claims
      request - HTTP request
      Returns:
      whether the JWT claims pass validation.