Class ClientInformationJWTTrustEngine

All Implemented Interfaces:
TrustedCredentialTrustEngine<SignedJWT>, TrustEngine<SignedJWT>

public class ClientInformationJWTTrustEngine extends ExplicitKeySignedJWTTrustEngine implements TrustedCredentialTrustEngine<SignedJWT>
An implementation of SignatureTrustEngine which evaluates the validity and trustworthiness of JWT signatures.

This extends ExplicitKeySignedJWTTrustEngine by adding a configurable lookup strategy for the signature algorithm that must be used in the incoming token. Also a default value can be set if the function returns no value. If neither function is returning value nor the default value is set, then any signature accepted by the parent class is accepted.

Since:
2.2.0
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • signatureAlgorithmLookupStrategy

      @Nonnull private final Function<OIDCClientInformation,String> signatureAlgorithmLookupStrategy
      A lookup function for the signature algorithm in the client metadata.
    • defaultAlgorithmValue

      @Nullable private final String defaultAlgorithmValue
      The default algorithm value used if lookup strategy returned null.
  • Constructor Details

  • Method Details

    • doValidate

      protected boolean doValidate(@Nonnull SignedJWT signedJWT, @Nonnull CriteriaSet trustBasisCriteria) throws SecurityException
      Validate the signed JWT using the supplied trust criteria.
      Overrides:
      doValidate in class ExplicitKeySignedJWTTrustEngine
      Parameters:
      signedJWT - the signed JWT to validate
      trustBasisCriteria - criteria used to describe and/or resolve the information which serves as the basis for trust evaluation
      Returns:
      true if signature is valid and trusted, false otherwise
      Throws:
      SecurityException - if there is a fatal error evaluating the signature
    • getExpectedAlgorithm

      @Nullable protected String getExpectedAlgorithm(@Nonnull ClientInformationCriterion criterion)
      Fetches the expected signature algorithm from the OIDCClientInformation.
      Parameters:
      criterion - criterion containing the client information/metadata.
      Returns:
      the expected algorithm value.