Class DefaultSAML20AssertionValidationContextBuilder

    • Field Detail

      • log

        @Nullable
        private org.slf4j.Logger log
        Logger.
      • signatureRequired

        private boolean signatureRequired
        Flag indicating whether an Assertion signature is required.
    • Constructor Detail

      • DefaultSAML20AssertionValidationContextBuilder

        public DefaultSAML20AssertionValidationContextBuilder()
        Constructor.
    • Method Detail

      • isSignatureRequired

        public boolean isSignatureRequired()
        Get the flag indicating whether an Assertion signature is required.

        Defaults to: true.

        Returns:
        true if required, false if not
      • setSignatureRequired

        public void setSignatureRequired​(boolean flag)
        Set the flag indicating whether an Assertion signature is required.

        Defaults to: true.

        Parameters:
        flag - true if required, false if not
      • getSignatureCriteriaSetFunction

        @Nullable
        public Function<Pair<MessageContext,​Assertion>,​CriteriaSet> getSignatureCriteriaSetFunction()
        Get the function for resolving the signature validation CriteriaSet for a particular function.

        Defaults to: null.

        Returns:
        a criteria set instance, or null
      • setSignatureCriteriaSetFunction

        public void setSignatureCriteriaSetFunction​(@Nullable
                                                    Function<Pair<MessageContext,​Assertion>,​CriteriaSet> function)
        Set the function for resolving the signature validation CriteriaSet for a particular function.

        Defaults to: null.

        Parameters:
        function - the resolving function, may be null
      • getAttesterCertificate

        @Nullable
        protected X509Certificate getAttesterCertificate​(@Nonnull
                                                         SAML20AssertionTokenValidationInput input)
        Get the attesting entity's X509Certificate.

        This implementation returns the client TLS certificate present in the HttpServletRequest, or null if one is not present.

        Parameters:
        input - the assertion validation input
        Returns:
        the entity certificate, or null
      • getAttesterPublicKey

        @Nullable
        protected PublicKey getAttesterPublicKey​(@Nonnull
                                                 SAML20AssertionTokenValidationInput input)
        Get the attesting entity's PublicKey.

        This implementation returns null. Subclasses should override to implement specific logic.

        Parameters:
        input - the assertion validation input
        Returns:
        the entity public key, or null
      • getValidRecipients

        @Nonnull
        protected Set<String> getValidRecipients​(@Nonnull
                                                 SAML20AssertionTokenValidationInput input)
        Get the valid recipient endpoints for attestation.

        This implementation returns a set containing the 2 values;

        1. HttpServletRequest.getRequestURL()
        2. if present, AbstractSAMLEntityContext.getEntityId()
        Parameters:
        input - the assertion validation input
        Returns:
        set of recipient endpoint URI's
      • getAttesterIPAddress

        @Nonnull
        protected String getAttesterIPAddress​(@Nonnull
                                              SAML20AssertionTokenValidationInput input)
        Get the attester's IP address.

        This implementation returns the value of ServletRequest.getRemoteAddr().

        Parameters:
        input - the assertion validation input
        Returns:
        the IP address of the attester
      • getValidAudiences

        @Nonnull
        protected Set<String> getValidAudiences​(@Nonnull
                                                SAML20AssertionTokenValidationInput input)
        Get the valid audiences for attestation.

        This implementation returns a set containing the single entityID held by the message context's AbstractSAMLEntityContext.getEntityId(), if present. Otherwise an empty set is returned.

        Parameters:
        input - the assertion validation input
        Returns:
        set of audience URI's