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">
9 class=
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
10 <property name=
"systemPropertiesModeName" value=
"SYSTEM_PROPERTIES_MODE_OVERRIDE" />
11 <property name=
"ignoreUnresolvablePlaceholders" value=
"true" />
12 <property name=
"locations">
13 <value>osgibundle:ldap.properties
18 <bean id=
"_authenticationManager" class=
"org.springframework.security.providers.ProviderManager">
19 <property name=
"providers">
21 <ref bean=
"authenticationProvider" />
26 <bean id=
"contextSource"
27 class=
"org.springframework.security.ldap.DefaultSpringSecurityContextSource">
29 value=
"ldap://${argeo.ldap.host}:${argeo.ldap.port}/${argeo.ldap.rootdn}" />
30 <property name=
"userDn" value=
"${argeo.ldap.manager.userdn}" />
31 <property name=
"password" value=
"${argeo.ldap.manager.password}" />
34 <bean id=
"authenticationProvider"
35 class=
"org.springframework.security.providers.ldap.LdapAuthenticationProvider">
36 <constructor-arg ref=
"ldapAuthenticator" />
38 <bean factory-bean=
"securityDao" factory-method=
"getAuthoritiesPopulator" />
40 <property name=
"userDetailsContextMapper">
41 <bean factory-bean=
"securityDao" factory-method=
"getUserDetailsMapper" />
45 <bean id=
"securityDao" class=
"org.argeo.security.ldap.ArgeoSecurityDaoLdap">
46 <constructor-arg ref=
"contextSource" />
47 <property name=
"userNatureMappers" ref=
"userNatureMappers" />
50 <bean id=
"ldapAuthenticator"
51 class=
"org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
52 <constructor-arg ref=
"contextSource" />
53 <property name=
"userDnPatterns">
55 <value>uid={
0},ou=users
</value>
58 <property name=
"passwordEncoder">
60 class=
"org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
66 <bean id="authoritiesPopulator"
67 class="org.argeo.security.ldap.ArgeoLdapAuthoritiesPopulator">
68 <constructor-arg ref="contextSource" /> <constructor-arg
69 value="ou=groups" /> <property name="defaultRole" value="ROLE_USER" />
70 <property name="groupSearchFilter" value="uniqueMember={0}" /> </bean>
72 <bean id="userDetailsManager"
73 class="org.springframework.security.userdetails.ldap.LdapUserDetailsManager">
74 <constructor-arg ref="contextSource" /> <property
75 name="userDetailsMapper" ref="userDetailsMapper" /> <property
76 name="groupSearchBase" value="ou=groups" /> <property
77 name="usernameMapper"> <bean
78 class="org.springframework.security.ldap.DefaultLdapUsernameToDnMapper">
79 <constructor-arg value="ou=users" /> <constructor-arg value="uid" />
80 </bean> </property> </bean> <bean id="userDetailsMapper"
81 class="org.argeo.security.ldap.ArgeoUserDetailsContextMapper">
82 <property name="userNatureMappers" ref="userNatureMappers" /> </bean>