]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - security/modules/org.argeo.security.manager.ldap/META-INF/spring/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">
8 <bean id=
"_authenticationManager" class=
"org.springframework.security.providers.ProviderManager">
9 <property name=
"providers">
11 <ref bean=
"authenticationProvider" />
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" />
23 <bean id=
"authenticationProvider"
24 class=
"org.springframework.security.providers.ldap.LdapAuthenticationProvider">
25 <constructor-arg ref=
"ldapAuthenticator" />
27 <bean factory-bean=
"securityDao" factory-method=
"getAuthoritiesPopulator" />
29 <property name=
"userDetailsContextMapper">
30 <bean factory-bean=
"securityDao" factory-method=
"getUserDetailsMapper" />
34 <bean id=
"securityDao" class=
"org.argeo.security.ldap.ArgeoSecurityDaoLdap">
35 <constructor-arg ref=
"contextSource" />
36 <property name=
"userNatureMappers" ref=
"userNatureMappers" />
39 <bean id=
"ldapAuthenticator"
40 class=
"org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
41 <constructor-arg ref=
"contextSource" />
42 <property name=
"userDnPatterns">
44 <value>uid={
0},ou=users
</value>
47 <property name=
"passwordEncoder">
49 class=
"org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
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>
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" />