Guest User

Untitled

a guest
Nov 11th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.38 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. </map>
  66. </constructor-arg>
  67.  
  68. <!-- Uncomment the metadata populator to capture the password.
  69. <property name="authenticationMetaDataPopulators">
  70. <util:list>
  71. <bean class="org.jasig.cas.authentication.CacheCredentialsMetaDataPopulator"/>
  72. </util:list>
  73. </property>
  74. -->
  75.  
  76. <!--
  77. | Defines the security policy around authentication. Some alternative policies that ship with CAS:
  78. |
  79. | * NotPreventedAuthenticationPolicy - all credential must either pass or fail authentication
  80. | * AllAuthenticationPolicy - all presented credential must be authenticated successfully
  81. | * RequiredHandlerAuthenticationPolicy - specifies a handler that must authenticate its credential to pass
  82. -->
  83. <property name="authenticationPolicy">
  84. <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />
  85. </property>
  86. </bean>
  87.  
  88. <!-- Required for proxy ticket mechanism. -->
  89. <bean id="proxyAuthenticationHandler"
  90. class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
  91. p:httpClient-ref="supportsTrustStoreSslSocketFactoryHttpClient" />
  92.  
  93. <!--
  94. | TODO: Replace this component with one suitable for your enviroment.
  95. |
  96. | This component provides authentication for the kind of credential used in your environment. In most cases
  97. | credential is a username/password pair that lives in a system of record like an LDAP directory.
  98. | The most common authentication handler beans:
  99. |
  100. | * org.jasig.cas.authentication.LdapAuthenticationHandler
  101. | * org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler
  102. | * org.jasig.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler
  103. | * org.jasig.cas.support.spnego.authentication.handler.support.JCIFSSpnegoAuthenticationHandler
  104. -->
  105. <bean id="primaryAuthenticationHandler"
  106. class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
  107. <property name="users">
  108. <map>
  109. <entry key="casuser4" value="Mellon4"/>
  110. <entry key="casuser5" value="Mellon5"/>
  111. <entry key="casuser6" value="Mellon6"/>
  112. </map>
  113. </property>
  114. </bean>
  115.  
  116. <!-- Required for proxy ticket mechanism -->
  117. <bean id="proxyPrincipalResolver"
  118. class="org.jasig.cas.authentication.principal.BasicPrincipalResolver" />
  119.  
  120. <!--
  121. | Resolves a principal from a credential using an attribute repository that is configured to resolve
  122. | against a deployer-specific store (e.g. LDAP).
  123. -->
  124. <bean id="primaryPrincipalResolver"
  125. class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver"
  126. p:principalFactory-ref="principalFactory"
  127. p:attributeRepository-ref="attributeRepository" />
  128.  
  129. <!--
  130. Bean that defines the attributes that a service may return. This example uses the Stub/Mock version. A real implementation
  131. may go against a database or LDAP server. The id should remain "attributeRepository" though.
  132. +-->
  133. <bean id="attributeRepository" class="org.jasig.services.persondir.support.NamedStubPersonAttributeDao"
  134. p:backingMap-ref="attrRepoBackingMap" />
  135.  
  136. <util:map id="attrRepoBackingMap">
  137. <entry key="uid" value="uid" />
  138. <entry key="eduPersonAffiliation" value="eduPersonAffiliation" />
  139. <entry key="groupMembership" value="groupMembership" />
  140. <entry>
  141. <key><value>memberOf</value></key>
  142. <list>
  143. <value>faculty</value>
  144. <value>staff</value>
  145. <value>org</value>
  146. </list>
  147. </entry>
  148. </util:map>
  149.  
  150. <!-- Sample, in-memory data store for the ServiceRegistry. A real implementation would probably want to replace this with the JPA-backed ServiceRegistry DAO The name of this bean should remain "serviceRegistryDao". -->
  151.  
  152. <bean
  153. id="serviceRegistryDao"
  154. class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
  155. <property name="registeredServices">
  156. <list>
  157. <bean class="org.jasig.cas.services.RegexRegisteredService">
  158. <property name="id" value="0" />
  159. <property name="name" value="HTTP and IMAP" />
  160. <property name="description" value="Allows HTTP(S) and IMAP(S) protocols" />
  161. <property name="serviceId" value="^(https?|imaps?)://.*" />
  162. <property name="evaluationOrder" value="10000001" />
  163. <property name="proxyPolicy">
  164. <bean class="org.jasig.cas.services.RegexMatchingRegisteredServiceProxyPolicy"
  165. c:pgtUrlPattern="^https?://.*" />
  166. </property>
  167. </bean>
  168.  
  169.  
  170. <!--
  171. Use the following definition instead of the above to further restrict access
  172. to services within your domain (including subdomains).
  173. Note that example.com must be replaced with the domain you wish to permit.
  174.  
  175.  
  176. <bean class="org.jasig.cas.services.RegexRegisteredService">
  177. <property name="id" value="1" />
  178. <property name="name" value="HTTP and IMAP on example.com" />
  179. <property name="description" value="Allows HTTP(S) and IMAP(S) protocols on example.com" />
  180. <property name="serviceId" value="^(https?|imaps?)://([A-Za-z0-9_-]+\.)*example\.com/.*" />
  181. <property name="evaluationOrder" value="0" />
  182. </bean> -->
  183.  
  184. </list>
  185. </property>
  186. </bean>
  187.  
  188.  
  189. <!--
  190. <bean id="serviceRegistryDao"
  191. class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"
  192. p:registeredServices-ref="registeredServicesList" />
  193.  
  194. <util:list id="registeredServicesList">
  195. <bean class="org.jasig.cas.services.RegexRegisteredService"
  196. p:id="1"
  197. p:name="HTTPS and IMAPS services on example.com"
  198. p:serviceId="https://([a-zA-Z0-9]+)\.mycompany\.com:([0-9]+)/([a-z\-]+)"
  199. p:evaluationOrder="0" />
  200. </util:list>
  201.  
  202. <bean class="org.jasig.cas.services.RegexRegisteredService"
  203. p:id="10000001" p:name="HTTP and IMAP"
  204. p:description="Allows HTTP(S) and IMAP(S) protocols"
  205. p:serviceId="^(https?|imaps?)://.*" p:evaluationOrder="10000001">
  206. <property name="proxyPolicy">
  207. <bean class="org.jasig.cas.services.RegexMatchingRegisteredServiceProxyPolicy"
  208. c:pgtUrlPattern="^https?://.*" />
  209. </property>
  210. </bean>
  211. -->
  212.  
  213. <!-- <bean id="serviceRegistryDao" class="org.jasig.cas.services.JsonServiceRegistryDao"
  214. c:configDirectory="file:/etc/cas/json" /> -->
  215.  
  216. <bean id="auditTrailManager" class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />
  217.  
  218. <bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />
  219.  
  220. <util:list id="monitorsList">
  221. <bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />
  222. <!--
  223. NOTE
  224. The following ticket registries support SessionMonitor:
  225. * DefaultTicketRegistry
  226. * JpaTicketRegistry
  227. Remove this monitor if you use an unsupported registry.
  228. -->
  229. <bean class="org.jasig.cas.monitor.SessionMonitor"
  230. p:ticketRegistry-ref="ticketRegistry"
  231. p:serviceTicketCountWarnThreshold="5000"
  232. p:sessionCountWarnThreshold="100000" />
  233. </util:list>
  234. </beans>
Advertisement
Add Comment
Please, Sign In to add comment