title: Query string not preserved in SAML HTTP Redirect binding
body: <p>We use the Spring SAML Security Extension to implement SAML in our application. We now have the following problem:</p>
  
  <p>One of our customers is providing a URL for their identity provider that contains a parameter. The metadata looks like this (heavily abbreviated for brevity):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;EntityDescriptor&gt;
    &lt;IDPSSODescriptor&gt;
      &lt;SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
          Location="https://idp.example.com/login?parameter=value"/&gt;
    &lt;/IDPSSODescriptor&gt;
  &lt;/EntityDescriptor&gt;
  </code></pre>
  
  <p>As can be seen, there is a parameter named "parameter" with a value "value". This parameter is not present in the generated redirect URL. I debugged a bit and found out that <code>SAMLProcessorImpl</code> gets the <code>MessageEncoder</code> from the binding (which is <code>HTTPRedirectDeflateEncoder</code> for HTTP redirect) and delegates encoding the message. The encoder in turn does the following in its <code>buildRedirectURL</code> method:</p>
  
  <pre><code>// endpointURL is https://idp.example.com/login?parameter=value here
  URLBuilder urlBuilder = new URLBuilder(endpointURL);
  
  List&lt;Pair&lt;String, String&gt;&gt; queryParams = urlBuilder.getQueryParams();
  queryParams.clear(); // whoops
  </code></pre>
  
  <p>So for some reason, the parameters are stripped intentionally and unconditionally.</p>
  
  <p>Why is this the case and how can I fix this in the most efficient way?</p>