Fix issue with username case in LDAP
[lgpl/argeo-commons.git] / security / modules / org.argeo.security.dao.ldap / META-INF / spring / ldap.xml
index 33dc554a87de4a0af7891448d5444aedd6a9ba0a..1f2117d1ae02328426bc5b31c0599b91cee5d25f 100644 (file)
                <property name="userDetailsContextMapper" ref="jcrUserDetailsContextMapper" />
        </bean>
 
+<!--   <bean id="ldapAuthenticator" -->
+<!--           class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"> -->
+<!--           <constructor-arg ref="contextSource" /> -->
+<!--           <property name="userDnPatterns"> -->
+<!--                   <list> -->
+<!--                           <value><![CDATA[${argeo.ldap.usernameAttribute}={0},${argeo.ldap.userBase}]]></value> -->
+<!--                   </list> -->
+<!--           </property> -->
+<!--   </bean> -->
+
+       <!-- PasswordComparisonAuthenticator doesn't work with SSHA -->
        <bean id="ldapAuthenticator"
-               class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
+               class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
                <constructor-arg ref="contextSource" />
                <property name="userDnPatterns">
                        <list>
                                <value><![CDATA[${argeo.ldap.usernameAttribute}={0},${argeo.ldap.userBase}]]></value>
                        </list>
                </property>
+               <property name="passwordAttributeName" value="${argeo.ldap.passwordAttribute}" />
+               <property name="passwordEncoder" ref="passwordEncoder" />
        </bean>
 
-       <!-- DOESN'T WORK WITH SSHA -->
-       <!-- <bean id="passwordComparisonAuthenticator" -->
-       <!-- class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator"> -->
-       <!-- <constructor-arg ref="contextSource" /> -->
-       <!-- <property name="userDnPatterns"> -->
-       <!-- <list> -->
-       <!-- <value><![CDATA[${argeo.ldap.usernameAttribute}={0},${argeo.ldap.userBase}]]></value> -->
-       <!-- </list> -->
-       <!-- </property> -->
-       <!-- <property name="passwordAttributeName" value="${argeo.ldap.passwordAttribute}" 
-               /> -->
-       <!-- <property name="passwordEncoder" ref="passwordEncoder" /> -->
-       <!-- </bean> -->
-
        <!-- USER DETAILS -->
        <bean id="userAdminDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
                <constructor-arg ref="contextSource" />