Class ProhibitedClaimsValidator

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

@ThreadSafeAfterInit public class ProhibitedClaimsValidator extends AbstractClaimsValidator
Verify the claims set does not contain any of the described set of claims.
  • Field Details

    • prohibitedClaims

      @Nonnull @NonnullElements private Set<String> prohibitedClaims
      The names of the JWT claims that must not be present, empty set if none.
  • Constructor Details

    • ProhibitedClaimsValidator

      public ProhibitedClaimsValidator()
      Constructor.
  • Method Details

    • setProhibitedClaims

      public void setProhibitedClaims(@Nullable Collection<String> claims)
      Set the prohibited claims.
      Parameters:
      claims - the prohibited claims.
    • doValidate

      public void doValidate(@Nonnull com.nimbusds.jwt.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