title: Recipient endpoint doesn't match with SAML response
body: <p>Usually my <strong>Spring SAML</strong>-based <strong>Service Provider (SP)</strong> implementation works fine, but sometimes it returns this error:</p>
  
  <pre><code>[2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseMessageDecoder:     Successfully decoded message.
  [2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Checking SAML message intended destination endpoint against receiver endpoint
  [2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Intended message destination endpoint: https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
  [2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Actual message receiver endpoint: http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
  [2014-07-17 16:00:58.768] boot - 1078 ERROR [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: SAML message intended destination endpoint 'https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias' did not match the recipient endpoint 'http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias'
  [2014-07-17 16:00:58.782] boot - 1078 DEBUG [http-bio-80-exec-1] --- SAMLProcessingFilter: Incoming SAML message is invalid
  org.opensaml.xml.security.SecurityException: SAML message intended destination endpoint did not match recipient endpoint
  ...
  </code></pre>
  
  <p>I'm using (as default setting of <strong>Spring Security</strong>) the <strong>HTTP Strict Transport Security (HSTS)</strong> on <strong>Tomcat 7</strong> with <strong>SSL</strong> enabled.</p>
  
  <p>Is there a way to fix this error?</p>
  
  <hr>
  
  <p><strong>Note:</strong> sample source code is on <em>Github</em>: <strong><a href="https://github.com/vdenotaris/spring-boot-security-saml-sample" rel="noreferrer">vdenotaris/spring-boot-security-saml-sample</a></strong>.</p>