<?xml version="1.0" encoding="UTF-8"?>
<!-- - Spring namespace-based configuration -->

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:security="http://www.springframework.org/schema/security"
	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.0.xsd
       http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security-3.0.xsd">

	<security:http auto-config="true" access-denied-page="/accessDenied.zul">
		<security:form-login login-page="/index.zul"
			default-target-url="/index.zul" authentication-failure-url="/index.zul"
			always-use-default-target='true' />
		<security:logout logout-success-url="/index.zul"
			invalidate-session="true" />

		<security:intercept-url pattern="/gui/img/**"
			access="IS_AUTHENTICATED_ANONYMOUSLY" />
		<security:intercept-url pattern="/gui/js/**"
			access="IS_AUTHENTICATED_ANONYMOUSLY" />
		<security:intercept-url pattern="/gui/**"
			access="IS_AUTHENTICATED_REMEMBERED" />
		<security:intercept-url pattern="/"
			access="IS_AUTHENTICATED_ANONYMOUSLY" />
		<security:intercept-url pattern="/login.zul"
			access="IS_AUTHENTICATED_ANONYMOUSLY" />
		<security:intercept-url pattern="/index.zul"
			access="IS_AUTHENTICATED_ANONYMOUSLY" />

	</security:http>

	<bean id="passwordEncoder"
		class="com.rjconsultores.ventaboletos.utilerias.spring.security.MiPasswordEncoder" />
	<security:authentication-manager>
		<security:authentication-provider
			user-service-ref="usuarioService">
			<security:password-encoder ref="passwordEncoder" />
		</security:authentication-provider>
	</security:authentication-manager>

</beans>

