1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <beans : beans xmlns =" http://www.springframework.org/schema/security"
3+ xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns : beans =" http://www.springframework.org/schema/beans"
4+ xmlns:mvc=" http://www.springframework.org/schema/mvc"
5+ xsi:schemaLocation="
6+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
7+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >
8+
9+
10+ <http use-expressions =" true" >
11+ <intercept-url pattern =" /login*" access =" permitAll" />
12+ <intercept-url pattern =" /logout*" access =" permitAll" />
13+ <intercept-url pattern =" /registration*" access =" permitAll" />
14+ <intercept-url pattern =" /resources/**" access =" permitAll" />
15+ <intercept-url pattern =" /invalidSession*" access =" isAnonymous()" />
16+ <intercept-url pattern =" /**" access =" isAuthenticated()" />
17+ <form-login login-page =' /login.html'
18+ authentication-failure-url=" /login.html?error=true"
19+ authentication-success-handler-ref=" myAuthenticationSuccessHandler"
20+ default-target-url=" /homepage.html" />
21+ <session-management invalid-session-url =" /invalidSession.html"
22+ session-fixation-protection=" none" />
23+ <logout invalidate-session =" false" logout-success-url =" /logout.html?logSucc=1"
24+ logout-url=" /j_spring_security_logout" delete-cookies =" JSESSIONID" />
25+ </http >
26+ <beans : bean id =" myAuthenticationSuccessHandler"
27+ class=" org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler" />
28+ <authentication-manager >
29+ <authentication-provider >
30+ <user-service >
31+ <user name =" user1" password =" user1Pass" authorities =" ROLE_USER" />
32+ <user name =" admin1" password =" admin1Pass" authorities =" ROLE_ADMIN" />
33+ </user-service >
34+ </authentication-provider >
35+ </authentication-manager >
36+ </beans : beans >
0 commit comments