clearpass-configuration.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to Jasig under one or more contributor license
  4. agreements. See the NOTICE file distributed with this work
  5. for additional information regarding copyright ownership.
  6. Jasig licenses this file to you under the Apache License,
  7. Version 2.0 (the "License"); you may not use this file
  8. except in compliance with the License. You may obtain a
  9. copy of the License at the following location:
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. -->
  18. <beans xmlns="http://www.springframework.org/schema/beans"
  19. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  20. xmlns:p="http://www.springframework.org/schema/p"
  21. xmlns:sec="http://www.springframework.org/schema/security"
  22. xsi:schemaLocation="
  23. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  24. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  25. <!-- Credentials Cache implementation -->
  26. <bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
  27. p:configLocation="classpath:ehcacheClearPass.xml"
  28. p:shared="false"
  29. p:cacheManagerName="ehCacheClearPassCacheManger"/>
  30. <bean id="clearPassEhCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"
  31. p:cacheManager-ref="ehCacheManager"
  32. p:cacheName="clearPassCache"/>
  33. <bean id="credentialsCache" class="org.jasig.cas.extension.clearpass.EhcacheBackedMap">
  34. <constructor-arg index="0" ref="clearPassEhCache"/>
  35. </bean>
  36. <!--
  37. NOTE:
  38. Name of delegated ticket registry bean in ticketRegistry.xml must be "ticketRegistryValue."
  39. -->
  40. <bean id="ticketRegistry" class="org.jasig.cas.extension.clearpass.TicketRegistryDecorator">
  41. <constructor-arg index="0" ref="ticketRegistryValue"/>
  42. <constructor-arg index="1" ref="credentialsCache"/>
  43. </bean>
  44. <!-- implementation of the clear pass vending service -->
  45. <bean id="clearPassController" class="org.jasig.cas.extension.clearpass.ClearPassController">
  46. <constructor-arg index="0" ref="credentialsCache"/>
  47. </bean>
  48. <bean id="handlerMappingClearPass" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
  49. p:alwaysUseFullPath="true">
  50. <property name="mappings">
  51. <props>
  52. <prop key="/clearPass">
  53. clearPassController
  54. </prop>
  55. </props>
  56. </property>
  57. </bean>
  58. <!-- Security configuration -->
  59. <bean id="clearPassFilterChainProxy" class="org.springframework.security.web.FilterChainProxy">
  60. <sec:filter-chain-map request-matcher="ant">
  61. <sec:filter-chain pattern="/clearPass"
  62. filters="casValidationFilter,httpServletRequestWrappingFilter"/>
  63. </sec:filter-chain-map>
  64. </bean>
  65. <!-- NOTE:
  66. It is dangerous to include a non-proxied CAS Filter for protecting /clearPass. Non-proxied CAS Filters
  67. like AuthenticationFilter don't honor the Filter chain proxy protection mechanism and, worse yet, allow access to the
  68. logged on user's cleartext password. It could be useful to enable this bean for easy testing of clearPass functionality however.-->
  69. <!--
  70. <bean id="casAuthenticationFilter" class="org.jasig.cas.client.authentication.AuthenticationFilter">
  71. <property name="casServerLoginUrl" value="${cas.securityContext.casProcessingFilterEntryPoint.loginUrl}"/>
  72. <property name="serverName" value="${server.name}"/>
  73. </bean>
  74. -->
  75. <!--
  76. NOTE:
  77. A bean named clearPassProxyList must be defined in deployerConfigContext.xml that defines
  78. the list of proxying services authorized to obtain clearpass credentials.
  79. -->
  80. <bean id="casValidationFilter" class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter">
  81. <property name="serverName" value="${server.name}"/>
  82. <property name="exceptionOnValidationFailure" value="false"/>
  83. <property name="useSession" value="true"/>
  84. <property name="ticketValidator">
  85. <bean class="org.jasig.cas.client.validation.Cas20ProxyTicketValidator">
  86. <constructor-arg index="0" value="${server.prefix}" />
  87. <property name="allowedProxyChains" ref="clearPassProxyList" />
  88. </bean>
  89. </property>
  90. </bean>
  91. <bean id="httpServletRequestWrappingFilter" class="org.jasig.cas.client.util.HttpServletRequestWrapperFilter"/>
  92. </beans>