title: Spring-Security Spring-LDAP bind with Active Directory using sAMAccountName attribute
body: <p>I have set up authentication against LDAP/AD and it is working fine. But now I wonder if it is possible to bind against Active Directory using the <code>sAMAccountNAme</code> attribute in the <code>userDNPattern</code>?</p>
  
  <p>Since some AD configuration prevents unauthenticated users to search, and I can't ask for a user in order to configure the context bean, I can't define a <code>org.springframework.security.ldap.search.FilterBasedLdapUserSearch</code> bean like:</p>
  
  <pre><code>&lt;bean id="userSearch"
      class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch"&gt;
      &lt;constructor-arg&gt;
          &lt;value&gt;&lt;/value&gt;
      &lt;/constructor-arg&gt;
      &lt;constructor-arg&gt;
          &lt;value&gt;(sAMAccountName={0})&lt;/value&gt;
      &lt;/constructor-arg&gt;
      &lt;constructor-arg ref="contextSource" /&gt;
      &lt;property name="searchSubtree"&gt;
          &lt;value&gt;true&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Which would be enough.</p>
  
  <p>Is there any work around?</p>