<?xml version="1.0" encoding="UTF-8"?>

<!--
========================================================================================================================
beans-security-special.xml

Copyright (c) 2013 Manning Publications Co.

Willie Wheeler (willie.wheeler@gmail.com)

Book: http://manning.com/wheeler/
Blog: http://springinpractice.com/
Code: https://github.com/springinpractice
========================================================================================================================
-->
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
		http://www.springframework.org/schema/security
		http://www.springframework.org/schema/security/spring-security-3.0.xsd">
	
	<!-- Allows us to show the username in the page template. -->
	<!-- The proxy in web.xml finds this using the proxy's filter name. -->
	<beans:bean id="specialFilterChainProxy" class="org.springframework.security.web.FilterChainProxy">
		<filter-chain-map path-type="ant">
			<filter-chain pattern="/**" filters="specialPersistenceFilter,specialAuthFilter" />
		</filter-chain-map>
	</beans:bean>
	
	<!-- Allows us to show the username in the page template. -->
	<beans:bean id="specialPersistenceFilter"
		class="org.springframework.security.web.context.SecurityContextPersistenceFilter" />
	
	<!-- Allows us to show the username in the page template. -->
	<beans:bean id="specialAuthFilter"
		class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter"
		p:authenticationManager-ref="authenticationManager"
		p:ignoreFailure="true" />
</beans:beans>
