]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap.xml
Remove static version-commons
[lgpl/argeo-commons.git] / security / modules / org.argeo.security.dao.ldap / META-INF / spring / ldap.xml
index 77a6ac7d5b48d9281420f38a67c5b9d8c562abd2..1f2117d1ae02328426bc5b31c0599b91cee5d25f 100644 (file)
@@ -13,8 +13,9 @@
                </property>
        </bean>
 
-       <bean id="passwordEncoder"
-               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+       <bean id="passwordEncoder" class="org.argeo.security.ldap.ArgeoLdapShaPasswordEncoder">
+               <property name="useSalt" value="${argeo.ldap.password.useSalt}" />
+       </bean>
 
        <bean id="contextSource"
                class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
        <!-- AUTHENTICATION -->
        <bean id="ldapAuthenticationProvider"
                class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
-               <constructor-arg ref="passwordComparisonAuthenticator" />
+               <constructor-arg ref="ldapAuthenticator" />
                <constructor-arg ref="authoritiesPopulator" />
                <property name="userDetailsContextMapper" ref="jcrUserDetailsContextMapper" />
        </bean>
 
-       <bean id="passwordComparisonAuthenticator"
+<!--   <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.PasswordComparisonAuthenticator">
                <constructor-arg ref="contextSource" />
                <property name="userDnPatterns">
@@ -45,7 +57,7 @@
        </bean>
 
        <!-- USER DETAILS -->
-       <bean id="securityDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
+       <bean id="userAdminDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
                <constructor-arg ref="contextSource" />
                <property name="userBase" value="${argeo.ldap.userBase}" />
                <property name="usernameAttribute" value="${argeo.ldap.usernameAttribute}" />
@@ -60,9 +72,7 @@
                <property name="groupMemberAttribute" value="${argeo.ldap.groupMemberAttribute}" />
                <property name="defaultRole" value="${argeo.security.defaultRole}" />
                <property name="rolePrefix" value="${argeo.security.rolePrefix}" />
-               <property name="passwordEncoder" ref="passwordEncoder" />
                <property name="usernameMapper" ref="usernameMapper" />
-               <property name="userDetailsManager" ref="userDetailsManager" />
        </bean>
 
        <bean id="usernameMapper"
@@ -86,6 +96,7 @@
                <property name="groupMemberAttributeName" value="${argeo.ldap.groupMemberAttribute}" />
                <property name="usernameMapper" ref="usernameMapper" />
                <property name="userDetailsMapper" ref="jcrUserDetailsContextMapper" />
+               <property name="userAdminDao" ref="userAdminDao" />
                <property name="passwordEncoder" ref="passwordEncoder" />
                <property name="passwordAttributeName" value="${argeo.ldap.passwordAttribute}" />
        </bean>