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

Benjamin Renard authored 9 years ago

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

Benjamin Renard authored 9 years ago

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

Benjamin Renard authored 9 years ago

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

Benjamin Renard authored 9 years ago

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