Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you authenticate against an Active Directory server using Spring Security?
    primarykey
    data
    text
    <p>I'm writing a Spring web application that requires users to login. My company has an Active Directory server that I'd like to make use of for this purpose. However, I'm having trouble using Spring Security to connect to the server.</p> <p>I'm using Spring 2.5.5 and Spring Security 2.0.3, along with Java 1.6.</p> <p>If I change the LDAP URL to the wrong IP address, it doesn't throw an exception or anything, so I'm wondering if it's even <em>trying</em> to connect to the server to begin with.</p> <p>Although the web application starts up just fine, any information I enter into the login page is rejected. I had previously used an InMemoryDaoImpl, which worked fine, so the rest of my application seems to be configured correctly.</p> <p>Here are my security-related beans:</p> <pre><code> &lt;beans:bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider"&gt; &lt;beans:constructor-arg&gt; &lt;beans:bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"&gt; &lt;beans:constructor-arg ref="initialDirContextFactory" /&gt; &lt;beans:property name="userDnPatterns"&gt; &lt;beans:list&gt; &lt;beans:value&gt;CN={0},OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Acme,DC=com&lt;/beans:value&gt; &lt;/beans:list&gt; &lt;/beans:property&gt; &lt;/beans:bean&gt; &lt;/beans:constructor-arg&gt; &lt;/beans:bean&gt; &lt;beans:bean id="userDetailsService" class="org.springframework.security.userdetails.ldap.LdapUserDetailsManager"&gt; &lt;beans:constructor-arg ref="initialDirContextFactory" /&gt; &lt;/beans:bean&gt; &lt;beans:bean id="initialDirContextFactory" class="org.springframework.security.ldap.DefaultInitialDirContextFactory"&gt; &lt;beans:constructor-arg value="ldap://192.168.123.456:389/DC=Acme,DC=com" /&gt; &lt;/beans:bean&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload