title: Spring security SAML Single logout service URL hitting twice
body: <p>getting issue while logging out using  the SAML SSL. SingleLogoutService URL hitting twice.</p>
  
  <p><a href="https://i.stack.imgur.com/x7jNz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x7jNz.png" alt="enter image description here"></a>
  <strong>SSL configuration in IDP.xml(SP) below:</strong></p>
  
  <pre><code>&lt;SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" 
  Location="https://sso-example.com/saml/idp/profile/post/sls"&gt;  
  &lt;/SingleLogoutService&gt;
  </code></pre>
  
  <p><strong><a href="https://sso-example.com/saml/idp/profile/post/sls" rel="nofollow noreferrer">https://sso-example.com/saml/idp/profile/post/sls</a></strong> (hitting twice)</p>
  
  <p>while hitting first it destroys cookies &amp; response was success and again second time hits the same url and return back error msg in response. </p>
  
  <p><strong>Spring security configuration in SP:</strong></p>
  
  <pre><code>&lt;bean id="samlFilter" class="org.springframework.security.web.FilterChainProxy"&gt;
      &lt;security:filter-chain-map request-matcher="ant"&gt;
          &lt;security:filter-chain pattern="/saml/login/**" filters="samlEntryPoint"/&gt;  
          &lt;security:filter-chain pattern="/saml/logout/**" filters="samlLogoutFilter"/&gt;  
          &lt;security:filter-chain pattern="/saml/metadata/**" filters="metadataDisplayFilter"/&gt;
          &lt;security:filter-chain pattern="/saml/SSO/**" filters="samlWebSSOProcessingFilter"/&gt;  
          &lt;security:filter-chain pattern="/saml/SSOHoK/**" filters="samlWebSSOHoKProcessingFilter"/&gt;  
          &lt;security:filter-chain pattern="/saml/SingleLogout/**" filters="samlLogoutProcessingFilter"/&gt;
          &lt;security:filter-chain pattern="/saml/discovery/**" filters="samlIDPDiscovery"/&gt;  
      &lt;/security:filter-chain-map&gt;  
  &lt;/bean&gt;
  
     &lt;!-- Handler for successful logout --&gt;  
  &lt;bean id="successLogoutHandler" class="org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler"&gt;  
      &lt;property name="defaultTargetUrl" value="/login/logout.psg"/&gt;  
  &lt;/bean&gt;  
  
      &lt;!-- Override default logout processing filter with the one processing SAML messages --&gt;  
  &lt;bean id="samlLogoutFilter" class="org.springframework.security.saml.SAMLLogoutFilter"&gt;
      &lt;constructor-arg index="0" ref="successLogoutHandler"/&gt;
      &lt;constructor-arg index="1" ref="logoutHandler"/&gt;
      &lt;constructor-arg index="2" ref="logoutHandler"/&gt;
  &lt;/bean&gt;
  
  &lt;!-- Filter processing incoming logout messages --&gt;  
  &lt;!-- First argument determines URL user will be redirected to after successful global logout --&gt;  
  &lt;bean id="samlLogoutProcessingFilter" class="org.springframework.security.saml.SAMLLogoutProcessingFilter"&gt;
      &lt;constructor-arg index="0" ref="successLogoutHandler"/&gt;
      &lt;constructor-arg index="1" ref="logoutHandler"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>would you please tell me  at what scenario this will happens ? and Is there any changes needed to fix ?</p>