Class HTTPRedirectDeflateEncoder

    • Field Detail

      • DISALLOWED_ENDPOINT_QUERY_PARAMS

        private static final Set<String> DISALLOWED_ENDPOINT_QUERY_PARAMS
        Params which are disallowed from appearing in the input endpoint URL.
      • log

        private final org.slf4j.Logger log
        Class logger.
    • Constructor Detail

      • HTTPRedirectDeflateEncoder

        public HTTPRedirectDeflateEncoder()
        Constructor.
    • Method Detail

      • getBindingURI

        public String getBindingURI()
      • removeSignature

        protected void removeSignature​(SAMLObject message)
        Removes the signature from the protocol message.
        Parameters:
        message - current message context
      • deflateAndBase64Encode

        protected String deflateAndBase64Encode​(SAMLObject message)
                                         throws MessageEncodingException
        DEFLATE (RFC1951) compresses the given SAML message.
        Parameters:
        message - SAML message
        Returns:
        DEFLATE compressed message
        Throws:
        MessageEncodingException - thrown if there is a problem compressing the message
      • buildRedirectURL

        protected String buildRedirectURL​(MessageContext messageContext,
                                          String endpoint,
                                          String message)
                                   throws MessageEncodingException
        Builds the URL to redirect the client to.
        Parameters:
        messageContext - current message context
        endpoint - endpoint URL to send encoded message to
        message - Deflated and Base64 encoded message
        Returns:
        URL to redirect client to
        Throws:
        MessageEncodingException - thrown if the SAML message is neither a RequestAbstractType or Response
      • removeDisallowedQueryParams

        protected void removeDisallowedQueryParams​(@Nonnull
                                                   List<Pair<String,​String>> queryParams)
        Remove disallowed query params from the supplied list.
        Parameters:
        queryParams - the list of query params on which to operate
      • getSignatureAlgorithmURI

        protected String getSignatureAlgorithmURI​(SignatureSigningParameters signingParameters)
                                           throws MessageEncodingException
        Gets the signature algorithm URI to use.
        Parameters:
        signingParameters - the signing parameters to use
        Returns:
        signature algorithm to use with the associated signing credential
        Throws:
        MessageEncodingException - thrown if the algorithm URI is not supplied explicitly and could not be derived from the supplied credential
      • generateSignature

        protected String generateSignature​(Credential signingCredential,
                                           String algorithmURI,
                                           String queryString)
                                    throws MessageEncodingException
        Generates the signature over the query string.
        Parameters:
        signingCredential - credential that will be used to sign query string
        algorithmURI - algorithm URI of the signing credential
        queryString - query string to be signed
        Returns:
        base64 encoded signature of query string
        Throws:
        MessageEncodingException - there is an error computing the signature