<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans"
	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.1.xsd
		">
	
	<http pattern="/static/**" security="none" />
	
	<http auto-config="true" use-expressions="true">
		<form-login login-page="/login"
			authentication-failure-url="/login?status=failed"
			default-target-url="/" />
		<logout logout-url="/logout" logout-success-url="/" />
		<access-denied-handler error-page="/accessdenied" />
		
		<!-- Access rules -->
		<intercept-url pattern="/" access="permitAll" />
		<intercept-url pattern="/login" access="permitAll" />
		<intercept-url pattern="/logout" access="permitAll" />
		<intercept-url pattern="/**" access="denyAll" />
	</http>
	
	<authentication-manager>
		<authentication-provider user-service-ref="userService" />
	</authentication-manager>
</beans:beans>
