40 lines
1.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
2013-07-15 19:42:05 +03:00
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/security
2016-12-05 13:11:56 +02:00
http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/beans
2016-12-05 13:11:56 +02:00
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"
2015-07-23 16:54:23 +03:00
>
2013-07-15 19:42:05 +03:00
<http use-expressions="true">
2015-07-23 16:54:23 +03:00
<intercept-url pattern="/anonymous*" access="isAnonymous()"/>
<intercept-url pattern="/login*" access="permitAll"/>
<intercept-url pattern="/**" access="isAuthenticated()"/>
2016-01-06 13:26:07 +02:00
<csrf disabled="true"/>
2015-07-23 16:54:23 +03:00
<form-login login-page='/login.html' authentication-success-handler-ref="myAuthenticationSuccessHandler" authentication-failure-url="/login.html?error=true"/>
2013-07-15 17:56:43 +03:00
2015-07-23 16:54:23 +03:00
<logout delete-cookies="JSESSIONID"/>
2013-12-31 19:12:12 +02:00
2015-07-23 16:54:23 +03:00
<remember-me key="uniqueAndSecret" token-validity-seconds="86400"/>
2013-12-31 19:12:12 +02:00
2013-07-15 19:42:05 +03:00
</http>
2015-07-23 16:54:23 +03:00
<beans:bean id="myAuthenticationSuccessHandler" class="org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler"/>
2013-07-15 19:42:05 +03:00
<authentication-manager>
<authentication-provider>
<user-service>
2015-07-23 16:54:23 +03:00
<user name="user1" password="user1Pass" authorities="ROLE_USER"/>
<user name="admin1" password="admin1Pass" authorities="ROLE_ADMIN"/>
2013-07-15 19:42:05 +03:00
</user-service>
</authentication-provider>
</authentication-manager>
<!-- <mvc:interceptors>
<bean id="loggerInterceptor" class="org.baeldung.web.interceptor.LoggerInterceptor" />
</mvc:interceptors> -->
</beans:beans>