Class HTTPPostDecoder

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, UnmodifiableComponent, MessageDecoder, HttpServletRequestMessageDecoder, SAMLMessageDecoder
Direct Known Subclasses:
HTTPPostSimpleSignDecoder

public class HTTPPostDecoder extends BaseSAMLHttpServletRequestDecoder implements SAMLMessageDecoder
Message decoder implementing the SAML 2.0 HTTP POST binding.
  • Field Details

  • Constructor Details

    • HTTPPostDecoder

      public HTTPPostDecoder()
  • Method Details

    • getBindingURI

      @Nonnull @NotEmpty public String getBindingURI()
      Gets the SAML binding URI supported by this decoder.
      Specified by:
      getBindingURI in interface SAMLMessageDecoder
      Returns:
      SAML binding URI supported by this decoder
    • getBindingDescriptor

      @Nullable public BindingDescriptor getBindingDescriptor()
      Get an optional BindingDescriptor to inject into SAMLBindingContext created.
      Returns:
      binding descriptor
    • setBindingDescriptor

      public void setBindingDescriptor(@Nullable BindingDescriptor descriptor)
      Set an optional BindingDescriptor to inject into SAMLBindingContext created.
      Parameters:
      descriptor - a binding descriptor
    • doDecode

      protected void doDecode() throws MessageDecodingException
      Performs the decoding logic. By the time this is called, this decoder has already been initialized and checked to ensure that it has not been destroyed.
      Specified by:
      doDecode in class AbstractMessageDecoder
      Throws:
      MessageDecodingException - thrown if there is a problem decoding the message
    • getBase64DecodedMessage

      @Nonnull protected Pair<InputStream,String> getBase64DecodedMessage(@Nonnull HttpServletRequest request) throws MessageDecodingException
      Gets the Base64 encoded message from the request and decodes it.
      Parameters:
      request - the inbound HTTP servlet request
      Returns:
      decoded message
      Throws:
      MessageDecodingException - thrown if the message does not contain a base64 encoded SAML message, or the message can not be base64-decoded.
    • populateBindingContext

      protected void populateBindingContext(@Nonnull MessageContext messageContext)
      Populate the context which carries information specific to this binding.
      Parameters:
      messageContext - the current message context
    • getMessageSize

      @Nullable protected Integer getMessageSize() throws MessageDecodingException
      Get the message size in bytes.

      The default implementation is to return null. Specific decoder implementation MUST implement this if message size limit enforcement is to be effectively enabled for that type of concrete decoder. Implementations may assume that the parameter set has already been validated and the request contains only 1 message parameter and 1 value for that parameter.

      Overrides:
      getMessageSize in class BaseSAMLHttpServletRequestDecoder
      Returns:
      the message size in bytes, or null if can not be determined
      Throws:
      MessageDecodingException - if there is a fatal error determining message size