PDA

View Full Version : Authentication with Spring LDAP in Web applications



pajarokillo
Dec 1st, 2006, 06:33 AM
Hi, i want to know how i should configure the Spring LDAP for to authenticate users in a web application.

My configuration is the below


<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyP laceholderConfigurer">
<property name="location" value="/application/ldap.properties" />
</bean>

<bean id="contextSource" class="org.springframework.ldap.support.LdapContextSource">
<property name="url" value="${url}" />
<property name="base" value="${base}" />
<property name="userName" value="${user}" />
<property name="password" value="${password}" />
</bean>

<bean id="ldapTemplate" class="org.springframework.ldap.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>

The problem is that with this configuration i can authenticate only a user. I want to authenticate dynamiclly users with theirs userNames and passwords, that's, custom authentication, but without using Acegi.

Can Someone show me some example about this?

rasky
Dec 1st, 2006, 09:10 AM
For full authentication in a web application I'd personally recommend Acegi. If still want to use plain Spring LDAP, have a look at this thread (http://forum.springframework.org/showthread.php?t=29063).