42 lines
1.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<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
http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
<http use-expressions="true" >
<intercept-url pattern="/anonymous*" access="isAnonymous()" />
<intercept-url pattern="/login*" access="permitAll" />
<intercept-url pattern="/**" access="isAuthenticated()" />
<form-login
login-page='/login.html'
login-processing-url="/perform_login"
2013-07-15 17:56:43 +03:00
authentication-success-handler-ref="myAuthenticationSuccessHandler"
authentication-failure-url="/login.html?error=true"
/>
2013-07-15 17:56:43 +03:00
<logout
logout-url="/perform_logout"
delete-cookies="JSESSIONID"
/>
</http>
2013-07-15 17:56:43 +03:00
<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="user2" password="user2Pass" authorities="ROLE_USER" />
2013-07-15 18:08:19 +03:00
<user name="admin1" password="admin1Pass" authorities="ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>