<?xml version="1.0" encoding="UTF-8"?>
<!--  Namespace type configuration  -->
<beans default-lazy-init="false" 
    xmlns="http://www.springframework.org/schema/beans" 	
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:sec="http://www.springframework.org/schema/security"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    	http://www.springframework.org/schema/security
		http://www.springframework.org/schema/security/spring-security-3.2.xsd 
    	http://www.springframework.org/schema/util
	    http://www.springframework.org/schema/util/spring-util-3.0.xsd">
 	
 	<!-- SSO stuff -->

	<bean id="exceptionTranslationFilter" 
		class="org.springframework.security.web.access.ExceptionTranslationFilter">
		<constructor-arg name="authenticationEntryPoint" ref="authenticationProcessingFilterEntryPoint"/>
		<property name="accessDeniedHandler">
    		<bean class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
      		<property name="errorPage" value="/register_1.html"/>
    	</bean>
  		</property>
	</bean>	
		
	<bean id="authenticationProcessingFilterEntryPoint"
	        class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
	  	<constructor-arg name="loginFormUrl" value="/register_1.html"/>
	  	<property name="forceHttps" value="true"/>
	</bean>

	<!--  filterSecurityInterceptor is defined in CCHTSecurity.xml  -->	
			
	<bean id="anonymousProcessingFilter"
		class="org.springframework.security.web.authentication.AnonymousAuthenticationFilter">
		<constructor-arg name="key" value="cchtAnonAuthKey"/>
	</bean>

	<bean id="httpRequestAccessDecisionManager" 
		class="org.springframework.security.access.vote.AffirmativeBased">
		<constructor-arg name="decisionVoters">
			<list>
				<ref bean="roleVoter"/>
			</list>
		</constructor-arg>
		<property name="allowIfAllAbstainDecisions" value="false" />
	</bean>
	
	<bean id="roleVoter" 
		class="org.springframework.security.access.vote.RoleVoter">
		<property name="rolePrefix" value="" />
	</bean>

	<bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
      <constructor-arg value="/ccht"/> <!-- URL redirected to after logout -->
      <constructor-arg>
         <list>
              <bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/>
         </list>
      </constructor-arg>
   </bean>

</beans>
