]> git.argeo.org Git - lgpl/argeo-commons.git/blob - ldap.xml
534bfe5df342ad9088f9b9db13438c85066f70f0
[lgpl/argeo-commons.git] / ldap.xml
1 <beans xmlns="http://www.springframework.org/schema/beans"
2 xmlns:security="http://www.springframework.org/schema/security"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
5 http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
6
7
8 <bean id="_authenticationManager" class="org.springframework.security.providers.ProviderManager">
9 <property name="providers">
10 <list>
11 <ref bean="authenticationProvider" />
12 </list>
13 </property>
14 </bean>
15
16 <bean id="contextSource"
17 class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
18 <constructor-arg value="ldap://localhost:10389/dc=demo,dc=argeo,dc=org" />
19 <property name="userDn" value="uid=admin,ou=system" />
20 <property name="password" value="secret" />
21 </bean>
22
23 <bean id="authenticationProvider"
24 class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
25 <constructor-arg ref="ldapAuthenticator" />
26 <constructor-arg>
27 <bean factory-bean="securityDao" factory-method="getAuthoritiesPopulator" />
28 </constructor-arg>
29 <property name="userDetailsContextMapper">
30 <bean factory-bean="securityDao" factory-method="getUserDetailsMapper" />
31 </property>
32 </bean>
33
34 <bean id="securityDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
35 <constructor-arg ref="contextSource" />
36 <property name="userNatureMappers" ref="userNatureMappers" />
37 </bean>
38
39 <bean id="ldapAuthenticator"
40 class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
41 <constructor-arg ref="contextSource" />
42 <property name="userDnPatterns">
43 <list>
44 <value>uid={0},ou=users</value>
45 </list>
46 </property>
47 <property name="passwordEncoder">
48 <bean
49 class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
50 </property>
51 </bean>
52
53
54 <!--
55 <bean id="authoritiesPopulator"
56 class="org.argeo.security.ldap.ArgeoLdapAuthoritiesPopulator">
57 <constructor-arg ref="contextSource" /> <constructor-arg
58 value="ou=groups" /> <property name="defaultRole" value="ROLE_USER" />
59 <property name="groupSearchFilter" value="uniqueMember={0}" /> </bean>
60
61 <bean id="userDetailsManager"
62 class="org.springframework.security.userdetails.ldap.LdapUserDetailsManager">
63 <constructor-arg ref="contextSource" /> <property
64 name="userDetailsMapper" ref="userDetailsMapper" /> <property
65 name="groupSearchBase" value="ou=groups" /> <property
66 name="usernameMapper"> <bean
67 class="org.springframework.security.ldap.DefaultLdapUsernameToDnMapper">
68 <constructor-arg value="ou=users" /> <constructor-arg value="uid" />
69 </bean> </property> </bean>
70 <bean id="userDetailsMapper" class="org.argeo.security.ldap.ArgeoUserDetailsContextMapper">
71 <property name="userNatureMappers" ref="userNatureMappers" />
72 </bean>
73 -->
74 </beans>