Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4. Licensed to Apereo under one or more contributor license
  5. agreements. See the NOTICE file distributed with this work
  6. for additional information regarding copyright ownership.
  7. Apereo licenses this file to you under the Apache License,
  8. Version 2.0 (the "License"); you may not use this file
  9. except in compliance with the License. You may obtain a
  10. copy of the License at the following location:
  11.  
  12. http://www.apache.org/licenses/LICENSE-2.0
  13.  
  14. Unless required by applicable law or agreed to in writing,
  15. software distributed under the License is distributed on an
  16. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, either express or implied. See the License for the
  18. specific language governing permissions and limitations
  19. under the License.
  20.  
  21. -->
  22. <!--
  23. | deployerConfigContext.xml centralizes into one file some of the declarative configuration that
  24. | all CAS deployers will need to modify.
  25. |
  26. | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.
  27. | The beans declared in this file are instantiated at context initialization time by the Spring
  28. | ContextLoaderListener declared in web.xml. It finds this file because this
  29. | file is among those declared in the context parameter "contextConfigLocation".
  30. |
  31. | By far the most common change you will need to make in this file is to change the last bean
  32. | declaration to replace the default authentication handler with
  33. | one implementing your approach for authenticating usernames and passwords.
  34. +-->
  35.  
  36. <beans xmlns="http://www.springframework.org/schema/beans"
  37. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  38. xmlns:p="http://www.springframework.org/schema/p"
  39. xmlns:c="http://www.springframework.org/schema/c"
  40. xmlns:tx="http://www.springframework.org/schema/tx"
  41. xmlns:util="http://www.springframework.org/schema/util"
  42. xmlns:sec="http://www.springframework.org/schema/security"
  43. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  44. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  45. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
  46. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  47.  
  48. <!--
  49. | The authentication manager defines security policy for authentication by specifying at a minimum
  50. | the authentication handlers that will be used to authenticate credential. While the AuthenticationManager
  51. | interface supports plugging in another implementation, the default PolicyBasedAuthenticationManager should
  52. | be sufficient in most cases.
  53. +-->
  54. <bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
  55. <constructor-arg>
  56. <map>
  57. <!--
  58. | IMPORTANT
  59. | Every handler requires a unique name.
  60. | If more than one instance of the same handler class is configured, you must explicitly
  61. | set its name to something other than its default name (typically the simple class name).
  62. -->
  63. <!--<entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
  64. <entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" />-->
  65. <entry key-ref="ldapAuthenticationHandler" value-ref="primaryPrincipalResolver"/>
  66. </map>
  67. </constructor-arg>
  68.  
  69. <!-- Uncomment the metadata populator to allow clearpass to capture and cache the password
  70. This switch effectively will turn on clearpass.
  71. <property name="authenticationMetaDataPopulators">
  72. <util:list>
  73. <bean class="org.jasig.cas.extension.clearpass.CacheCredentialsMetaDataPopulator"
  74. c:credentialCache-ref="encryptedMap" />
  75. </util:list>
  76. </property>
  77. -->
  78.  
  79. <!--
  80. | Defines the security policy around authentication. Some alternative policies that ship with CAS:
  81. |
  82. | * NotPreventedAuthenticationPolicy - all credential must either pass or fail authentication
  83. | * AllAuthenticationPolicy - all presented credential must be authenticated successfully
  84. | * RequiredHandlerAuthenticationPolicy - specifies a handler that must authenticate its credential to pass
  85. -->
  86. <property name="authenticationPolicy">
  87. <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />
  88. </property>
  89. </bean>
  90.  
  91. <!-- Required for proxy ticket mechanism. -->
  92. <bean id="proxyAuthenticationHandler"
  93. class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
  94. p:httpClient-ref="supportsTrustStoreSslSocketFactoryHttpClient" />
  95.  
  96. <!--
  97. | TODO: Replace this component with one suitable for your enviroment.
  98. |
  99. | This component provides authentication for the kind of credential used in your environment. In most cases
  100. | credential is a username/password pair that lives in a system of record like an LDAP directory.
  101. | The most common authentication handler beans:
  102. |
  103. | * org.jasig.cas.authentication.LdapAuthenticationHandler
  104. | * org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler
  105. | * org.jasig.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler
  106. | * org.jasig.cas.support.spnego.authentication.handler.support.JCIFSSpnegoAuthenticationHandler
  107. -->
  108. <bean id="primaryAuthenticationHandler"
  109. class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
  110. <property name="users">
  111. <map>
  112. <entry key="casuser" value="Mellon"/>
  113. </map>
  114. </property>
  115. </bean>
  116.  
  117. <!-- Required for proxy ticket mechanism -->
  118. <bean id="proxyPrincipalResolver"
  119. class="org.jasig.cas.authentication.principal.BasicPrincipalResolver" />
  120.  
  121. <!--
  122. | Resolves a principal from a credential using an attribute repository that is configured to resolve
  123. | against a deployer-specific store (e.g. LDAP).
  124. -->
  125.  
  126. <bean id="primaryPrincipalResolver"
  127. class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver" >
  128. <property name="attributeRepository" ref="attributeRepository" />
  129. </bean>
  130. <bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"
  131. p:backingMap-ref="attrRepoBackingMap" />
  132.  
  133. <util:map id="attrRepoBackingMap">
  134. <entry key="uid" value="uid" />
  135. <!--<entry key="eduPersonAffiliation" value="eduPersonAffiliation" />
  136. <entry key="groupMembership" value="groupMembership" />
  137. <entry>
  138. <key><value>memberOf</value></key>
  139. <list>
  140. <value>Administratorzy domeny</value>
  141. <value>staff</value>
  142. <value>org</value>
  143. .</list>
  144. </entry>-->
  145. </util:map>
  146.  
  147. <!--
  148. Sample, in-memory data store for the ServiceRegistry. A real implementation
  149. would probably want to replace this with the JPA-backed ServiceRegistry DAO
  150. The name of this bean should remain "serviceRegistryDao".
  151. +-->
  152. <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"
  153. p:registeredServices-ref="registeredServicesList" />
  154.  
  155. <util:list id="registeredServicesList">
  156. <bean class="org.jasig.cas.services.RegexRegisteredService"
  157. p:id="0" p:name="Apereo" p:description="Apereo foundation sample service"
  158. p:serviceId="^https://www.apereo.org" p:evaluationOrder="0"
  159. p:theme="apereo" />
  160.  
  161. <bean class="org.jasig.cas.services.RegexRegisteredService"
  162. p:id="10000001" p:name="HTTPS and IMAPS"
  163. p:description="This service definition authorized all application urls that support HTTPS and IMAPS protocols."
  164. p:serviceId="^(https|imaps)://.*" p:evaluationOrder="10000001">
  165.  
  166.  
  167. </bean>
  168. </util:list>
  169.  
  170. <bean id="auditTrailManager" class="com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />
  171.  
  172. <bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />
  173.  
  174. <util:list id="monitorsList">
  175. <bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />
  176. <!--
  177. NOTE
  178. The following ticket registries support SessionMonitor:
  179. * DefaultTicketRegistry
  180. * JpaTicketRegistry
  181. Remove this monitor if you use an unsupported registry.
  182. -->
  183. <bean class="org.jasig.cas.monitor.SessionMonitor"
  184. p:ticketRegistry-ref="ticketRegistry"
  185. p:serviceTicketCountWarnThreshold="5000"
  186. p:sessionCountWarnThreshold="100000" />
  187. </util:list>
  188.  
  189.  
  190. <bean id="ldapAuthenticationHandler"
  191. class="org.jasig.cas.authentication.LdapAuthenticationHandler"
  192. p:principalIdAttribute="sAMAccountName"
  193. c:authenticator-ref="authenticator">
  194. <property name="principalAttributeMap">
  195. <map>
  196. <!--
  197. | This map provides a simple attribute resolution mechanism.
  198. | Keys are LDAP attribute names, values are CAS attribute names.
  199. | Use this facility instead of a PrincipalResolver if LDAP is
  200. | the only attribute source.
  201. -->
  202. <entry key="displayName" value="displayName" />
  203. <entry key="mail" value="mail" />
  204. <entry key="memberOf" value="memberOf" />
  205. </map>
  206. </property>
  207. </bean>
  208.  
  209. <bean id="authenticator" class="org.ldaptive.auth.Authenticator"
  210. c:resolver-ref="dnResolver"
  211. c:handler-ref="authHandler"
  212. p:entryResolver-ref="entryResolver" />
  213.  
  214. <!-- Active Directory UPN format. -->
  215. <bean id="dnResolver"
  216. class="org.ldaptive.auth.FormatDnResolver"
  217. c:format="%s@${ldap.domain}" />
  218.  
  219. <bean id="authHandler" class="org.ldaptive.auth.PooledBindAuthenticationHandler"
  220. p:connectionFactory-ref="pooledLdapConnectionFactory" />
  221.  
  222. <bean id="pooledLdapConnectionFactory"
  223. class="org.ldaptive.pool.PooledConnectionFactory"
  224. p:connectionPool-ref="connectionPool" />
  225. <bean id="connectionPool"
  226. class="org.ldaptive.pool.BlockingConnectionPool"
  227. init-method="initialize"
  228. p:poolConfig-ref="ldapPoolConfig"
  229. p:blockWaitTime="${ldap.pool.blockWaitTime}"
  230. p:validator-ref="searchValidator"
  231. p:pruneStrategy-ref="pruneStrategy"
  232. p:connectionFactory-ref="connectionFactory" />
  233.  
  234. <bean id="ldapPoolConfig" class="org.ldaptive.pool.PoolConfig"
  235. p:minPoolSize="${ldap.pool.minSize}"
  236. p:maxPoolSize="${ldap.pool.maxSize}"
  237. p:validateOnCheckOut="${ldap.pool.validateOnCheckout}"
  238. p:validatePeriodically="${ldap.pool.validatePeriodically}"
  239. p:validatePeriod="${ldap.pool.validatePeriod}" />
  240.  
  241. <bean id="connectionFactory" class="org.ldaptive.DefaultConnectionFactory"
  242. p:connectionConfig-ref="connectionConfig" />
  243.  
  244. <bean id="connectionConfig" class="org.ldaptive.ConnectionConfig"
  245. p:ldapUrl="${ldap.url}"
  246. p:connectTimeout="${ldap.connectTimeout}"
  247. p:useStartTLS="${ldap.useStartTLS}"
  248. p:sslConfig-ref="sslConfig" />
  249.  
  250. <bean id="sslConfig" class="org.ldaptive.ssl.SslConfig">
  251. <property name="credentialConfig">
  252. <bean class="org.ldaptive.ssl.X509CredentialConfig"
  253. p:trustCertificates="${ldap.trustedCert}" />
  254. </property>
  255. </bean>
  256.  
  257. <bean id="pruneStrategy" class="org.ldaptive.pool.IdlePruneStrategy"
  258. p:prunePeriod="${ldap.pool.prunePeriod}"
  259. p:idleTime="${ldap.pool.idleTime}" />
  260.  
  261. <bean id="searchValidator" class="org.ldaptive.pool.SearchValidator" />
  262.  
  263. <bean id="entryResolver"
  264. class="org.jasig.cas.authentication.support.UpnSearchEntryResolver"
  265. p:baseDn="${ldap.baseDn}"
  266. p:searchUserOnly="false"
  267. p:searchFilter="${ldap.searchFilter}" />
  268. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement