Class ChEprAssertionValidator

java.lang.Object
org.projecthusky.xua.validation.ChEprAssertionValidator

@ThreadSafe public class ChEprAssertionValidator extends Object
A component capable of performing core validation of SAML version 2.0 Assertion instances in use in the CH-EPR domain.

The calling application needs to initiate the SAML library by calling InitializationService.initialize().

Supports all static validation parameters (see SAML2AssertionValidationParameters). The following are recommended:

  • SAML2AssertionValidationParameters.CLOCK_SKEW: Optional. If not present the default clock skew of Duration.ZERO will be used. The SAML 2.0 specification recommend supporting a clock skew.
  • SAML2AssertionValidationParameters.COND_VALID_AUDIENCES: Optional. The set of allowed audiences.

The required conditions and attributes are extracted, verified then put in the ValidationContext dynamic parameters and can easily be retrieved after validation. See ChEprAssertionValidationParameters for the list.

Author:
Quentin Ligier
  • Field Details

  • Constructor Details

    • ChEprAssertionValidator

      public ChEprAssertionValidator(@Nullable Duration oneTimeUseConditionExpires, @Nullable org.opensaml.xmlsec.signature.support.SignatureTrustEngine signatureTrustEngine) throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
      Constructor.
      Parameters:
      oneTimeUseConditionExpires - The time for disposal of tracked assertion from the replay cache. If null, the OneTimeUseCondition is not enforced.
      signatureTrustEngine - The trust engine to use to validate signatures. This can be an ExplicitKeySignatureTrustEngine or any other implementation. A KeyInfoCredentialResolver is not needed, as we don't expect a KeyInfo in the CH:XUA assertions.
      Throws:
      net.shibboleth.utilities.java.support.component.ComponentInitializationException - if the ReplayCache of the OneTimeUseConditionValidator fails to initialize.
  • Method Details

    • validate

      public ChEprValidationResult validate(org.opensaml.saml.saml2.core.Assertion assertion, @Nullable Map<String,@Nullable Object> staticParameters) throws org.opensaml.saml.common.assertion.AssertionValidationException
      Validate the supplied SAML 2 Assertion, using the parameters from the supplied ValidationContext.
      Parameters:
      assertion - The assertion being evaluated.
      staticParameters - ?? or null.
      Returns:
      the validation result.
      Throws:
      org.opensaml.saml.common.assertion.AssertionValidationException - if there is a fatal error evaluating the validity of the assertion.