bbf23fa6c83be31f69d6daafbc46bf046515976a
Benjamin Renard Added ldap-auth.xml file fr...

Benjamin Renard authored 9 years ago

1) <?xml version="1.0" encoding="UTF-8"?>
2) <!--
3) 	| deployerConfigContext.xml centralizes into one file some of the declarative configuration that
4) 	| all CAS deployers will need to modify.
5) 	|
6) 	| This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.  
7) 	| The beans declared in this file are instantiated at context initialization time by the Spring 
8) 	| ContextLoaderListener declared in web.xml.  It finds this file because this
9) 	| file is among those declared in the context parameter "contextConfigLocation".
10) 	|
11) 	| By far the most common change you will need to make in this file is to change the last bean
12) 	| declaration to replace the default SimpleTestUsernamePasswordAuthenticationHandler with
13) 	| one implementing your approach for authenticating usernames and passwords.
14) 	+-->
15) <beans xmlns="http://www.springframework.org/schema/beans"
16)        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17)        xmlns:p="http://www.springframework.org/schema/p"
Benjamin Renard Added attributeRepository b...

Benjamin Renard authored 9 years ago

18)        xmlns:util="http://www.springframework.org/schema/util"
19)        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
Benjamin Renard Added ldap-auth.xml file fr...

Benjamin Renard authored 9 years ago

20) 	
21) 	<!--
22) 		|    LDAP authentication.
23) 	+-->
Benjamin Renard Created independent bean fo...

Benjamin Renard authored 9 years ago

24) 	<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
25) 		<property name="anonymousReadOnly" value="false" />
26) 		<property name="pooled" value="false" />
27) 		<property name="urls">
28) 			<list>
29) 				<value>${ldap.host.1}</value>
30) 				<value>${ldap.host.2}</value>
31) 			</list>
32) 		</property>
Benjamin Renard Add LDAP manager bind DN an...

Benjamin Renard authored 9 years ago

33) 		<property name="userDn" value="${ldap.manager.dn}"/>
34) 		<property name="password" value="${ldap.manager.password}"/>
Benjamin Renard Created independent bean fo...

Benjamin Renard authored 9 years ago

35) 		<property name="baseEnvironmentProperties">
36) 			<map>
37) 				<!-- 
38) 				<entry>
39) 				    <key><value>java.naming.security.protocol</value></key>
40) 				<value>ssl</value>
41) 			</entry>
42) 			-->
43) 				<entry>
44) 					<key><value>java.naming.security.authentication</value></key>
45) 					<value>simple</value>
46) 				</entry>
47) 			</map>
48) 		</property>
49) 	</bean>
Benjamin Renard Transformed ldapHandler fro...

Benjamin Renard authored 9 years ago

50) 	<bean id="ldapHandler" class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
51) 		<property name="filter" value="(|(uid=%u)(mail=%u))" />
52) 		<property name="searchBase" value="${ldap.basedn}" />
Benjamin Renard Created independent bean fo...

Benjamin Renard authored 9 years ago

53) 		<property name="contextSource" ref="contextSource" />
Benjamin Renard Added ldap-auth.xml file fr...

Benjamin Renard authored 9 years ago

54) 	</bean>
Benjamin Renard Added attributeRepository b...

Benjamin Renard authored 9 years ago

55) 
56) 	<util:set id="ldapLoginAttributes">
57) 		<value>uid</value>
58) 		<value>mail</value>
59) 	</util:set>
60) 
61) 	<bean id="attributeRepository"  class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
62) 		<property name="contextSource" ref="contextSource" />
63) 		<property name="baseDN" value="${ldap.basedn}" />
64) 		<property name="requireAllQueryAttributes" value="true" />
65) 
66) 		<property name="queryType" value="OR" />
67) 		<property name="queryAttributeMapping">
68) 			<map>
69) 				<entry key="username" value-ref="ldapLoginAttributes"/>
70) 			</map>
71) 		</property>
72) 
73) 		<property name="resultAttributeMapping">
74) 			<map>
75) 				<entry value="name" key="cn" />
76) 				<entry value="firstname" key="givenName" />
77) 				<entry value="lastname" key="sn" />
78) 				<entry value="mail" key="mail" />
79) 				<entry value="login" key="uid" />
80) 			</map>
81) 		</property>
82) 	</bean>
83)