Hello,
I would like to know if anybody has tried encrypting the password entered by the user from the login page before actually passed to authentication using Spring security against LDAP.
I am using a one way encrypting the password before it is stored in LDAP. Therefore when I login I need to do a one way encryption again before Spring security can authenticate it against LDAP.
Is there a way to encrypt the password before being handed to Spring security before authentication. My config looks like this. Greatly appreciate your replies.
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.5.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schem...rity-2.0.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<http>
<!--
<intercept-url pattern="/flow.html" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/homePage.html" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
-->
<intercept-url pattern="/mainMenu.html" access="ROLE_INVESTORPORTALUSER"/>
<intercept-url pattern="/update/*" access="ROLE_INVESTORPORTALUSER"/>
<intercept-url pattern="/product/*" access="ROLE_INVESTORPORTALUSER"/>
<form-login login-page="/login.html"
default-target-url="/mainMenu.html"
authentication-failure-url="/login.html?login_error=1"/>
<logout logout-success-url="/"/>
</http>
<beans:bean id="contextSource" class="org.springframework.security.ldap.DefaultSp ringSecurityContextSource">
<beans:constructor-arg value="${ldap.host}"/>
<beans:property name="userDn" value="${ldap.username}"/>
<beans:property name="password" value="${ldap.password}"/>
</beans:bean>
<beans:bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap .LdapAuthenticationProvider">
<custom-authentication-provider />
<beans:constructor-arg>
<beans:bean class="org.springframework.security.providers.ldap .authenticator.BindAuthenticator">
<beans:constructor-arg ref="contextSource"/>
<beans:property name="userDnPatterns">
<beans:list>
<beans:value>${ldap.userDn}</beans:value>
</beans:list>
</beans:property>
</beans:bean>
</beans:constructor-arg>
<beans:constructor-arg>
<beans:bean class="org.springframework.security.ldap.populator .DefaultLdapAuthoritiesPopulator">
<beans:constructor-arg ref="contextSource"/>
<beans:constructor-arg value="${ldap.groupDn}"/>
<beans:property name="groupSearchFilter" value="(uniquemember=cn={1}*)"/>
</beans:bean>
</beans:constructor-arg>
</beans:bean>
</beans:beans>



