title: Single sign-on not working in Spring web app
body: <p>I configured my web application to authenticate via Active Directory repo and it works fine, but I always need to insert credentials in login form.</p>
  
  <p>The application clients will be Windows machines connected to the company network all in the same domain.</p>
  
  <p>I need to configure my web app to authenticate automatically the user that has been yet authenticated in  Windows.</p>
  
  <p>I'm using this config for Spring Security:</p>
  
  <pre><code>&lt;security:authentication-manager alias="authenticationManager"&gt;
      &lt;security:authentication-provider
          user-service-ref="userDetailsService"&gt;
          &lt;security:password-encoder hash="plaintext" /&gt;
      &lt;/security:authentication-provider&gt; &lt;!-- for DB authentication --&gt;
      &lt;security:authentication-provider
          ref="adAuthenticationProvider" /&gt;
  &lt;/security:authentication-manager&gt;
  
  &lt;bean id="adAuthenticationProvider"
      class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider"&gt;
      &lt;constructor-arg name="domain" value="mydomain.it" /&gt;
      &lt;constructor-arg name="url" value="ldap://domaincontroller.mydomain.it/" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>NOTE</strong> I also need a secondary authentication provider to provide DB authentication.</p>
  
  <p>I also set the following option in IE (v 9) that should enable automatic logon:</p>
  
  <p><img src="https://i.stack.imgur.com/uTh9S.png" alt="enter image description here"></p>
  
  <p>But it doesn't work... so what's wrong in my configuration?</p>
  
  <p><strong>NOTE #2</strong> I'm using Spring v 3.2.9 and Spring Security v 3.2.3</p>