2013-07-14 15:25:28 +03:00
|
|
|
<?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="
|
2013-07-14 15:25:28 +03:00
|
|
|
http://www.springframework.org/schema/security
|
2013-12-18 13:25:45 +02:00
|
|
|
http://www.springframework.org/schema/security/spring-security-3.2.xsd
|
2013-07-14 15:25:28 +03:00
|
|
|
http://www.springframework.org/schema/beans
|
2014-09-15 14:26:17 +03:00
|
|
|
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
|
2013-07-14 15:25:28 +03:00
|
|
|
|
2013-07-15 19:42:05 +03:00
|
|
|
<http use-expressions="true">
|
|
|
|
|
<intercept-url pattern="/anonymous*" access="isAnonymous()" />
|
2013-07-14 15:25:28 +03:00
|
|
|
<intercept-url pattern="/login*" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/**" access="isAuthenticated()" />
|
|
|
|
|
|
2013-07-15 19:42:05 +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
|
|
|
|
2013-07-15 19:42:05 +03:00
|
|
|
<logout delete-cookies="JSESSIONID" />
|
2013-12-31 19:12:12 +02:00
|
|
|
|
|
|
|
|
<remember-me key="uniqueAndSecret" token-validity-seconds="86400" />
|
|
|
|
|
|
2013-07-15 19:42:05 +03:00
|
|
|
</http>
|
|
|
|
|
|
|
|
|
|
<beans:bean id="myAuthenticationSuccessHandler" class="org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler" />
|
|
|
|
|
|
|
|
|
|
<authentication-manager>
|
|
|
|
|
<authentication-provider>
|
|
|
|
|
<user-service>
|
|
|
|
|
<user name="user1" password="user1Pass" authorities="ROLE_USER" />
|
|
|
|
|
<user name="admin1" password="admin1Pass" authorities="ROLE_ADMIN" />
|
|
|
|
|
</user-service>
|
|
|
|
|
</authentication-provider>
|
|
|
|
|
</authentication-manager>
|
2013-07-14 15:25:28 +03:00
|
|
|
|
|
|
|
|
</beans:beans>
|