Zionetrix::Git
Repositories
Help
Report an Issue
cas-common-config
Code
Commits
Branches
Tags
Search
Tree:
f106cbe
Branches
Tags
master
cas-common-config
custom
webpages
WEB-INF
auth-configuration
ldap-auth.xml
Added attributeRepository bean (LdapPersonAttributeDao)
Benjamin Renard
commited
f106cbe
at 2014-12-11 14:01:00
ldap-auth.xml
Blame
History
Raw
<?xml version="1.0" encoding="UTF-8"?> <!-- | deployerConfigContext.xml centralizes into one file some of the declarative configuration that | all CAS deployers will need to modify. | | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment. | The beans declared in this file are instantiated at context initialization time by the Spring | ContextLoaderListener declared in web.xml. It finds this file because this | file is among those declared in the context parameter "contextConfigLocation". | | By far the most common change you will need to make in this file is to change the last bean | declaration to replace the default SimpleTestUsernamePasswordAuthenticationHandler with | one implementing your approach for authenticating usernames and passwords. +--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util" 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"> <!-- | LDAP authentication. +--> <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"> <property name="anonymousReadOnly" value="false" /> <property name="pooled" value="false" /> <property name="urls"> <list> <value>${ldap.host.1}</value> <value>${ldap.host.2}</value> </list> </property> <property name="baseEnvironmentProperties"> <map> <!-- <entry> <key><value>java.naming.security.protocol</value></key> <value>ssl</value> </entry> --> <entry> <key><value>java.naming.security.authentication</value></key> <value>simple</value> </entry> </map> </property> </bean> <bean id="ldapHandler" class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"> <property name="filter" value="(|(uid=%u)(mail=%u))" /> <property name="searchBase" value="${ldap.basedn}" /> <property name="contextSource" ref="contextSource" /> </bean> <util:set id="ldapLoginAttributes"> <value>uid</value> <value>mail</value> </util:set> <bean id="attributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao"> <property name="contextSource" ref="contextSource" /> <property name="baseDN" value="${ldap.basedn}" /> <property name="requireAllQueryAttributes" value="true" /> <property name="queryType" value="OR" /> <property name="queryAttributeMapping"> <map> <entry key="username" value-ref="ldapLoginAttributes"/> </map> </property> <property name="resultAttributeMapping"> <map> <entry value="name" key="cn" /> <entry value="firstname" key="givenName" /> <entry value="lastname" key="sn" /> <entry value="mail" key="mail" /> <entry value="login" key="uid" /> </map> </property> </bean> </beans>