|
14 | 14 | http://www.springframework.org/schema/security/spring-security.xsd"> |
15 | 15 |
|
16 | 16 | <!-- Spring security --> |
17 | | - |
18 | | - <!-- |
19 | | - http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity-single.html |
20 | | - --> |
21 | 17 |
|
22 | 18 | <security:http pattern="/resources/**" security="none"/> |
23 | 19 | <security:http pattern="/product/**" security="none"/> |
|
27 | 23 |
|
28 | 24 | <security:http pattern="/admin/**" |
29 | 25 | authentication-manager-ref="authenticationManagerAdmin" |
30 | | - use-expressions='true'> |
| 26 | + use-expressions="true" |
| 27 | + disable-url-rewriting="false" |
| 28 | + auto-config="false"> |
| 29 | + <security:headers disabled="true"/> |
| 30 | + <security:csrf disabled="true"/> |
31 | 31 | <security:intercept-url pattern="/admin/login*" access="permitAll"/> |
32 | 32 | <security:intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" /> |
33 | 33 | <security:form-login |
34 | 34 | login-page="/admin/login" |
35 | 35 | authentication-failure-url="/admin/login?login_error=1" |
36 | | - default-target-url="/admin/"/> |
| 36 | + default-target-url="/admin/" |
| 37 | + login-processing-url="/admin/j_spring_security_check"/> |
37 | 38 | <security:logout |
38 | 39 | logout-url="/admin/j_spring_security_logout" |
39 | 40 | logout-success-url="/admin/" |
|
44 | 45 |
|
45 | 46 | <security:http pattern="/**" |
46 | 47 | authentication-manager-ref="authenticationManagerCustomer" |
47 | | - use-expressions='true'> |
| 48 | + use-expressions='true' |
| 49 | + disable-url-rewriting="false" |
| 50 | + auto-config="false"> |
| 51 | + <security:headers disabled="true"/> |
| 52 | + <security:csrf disabled="true"/> |
48 | 53 | <security:intercept-url pattern="/" access="permitAll"/> |
49 | 54 | <security:intercept-url pattern="/product/**" access="permitAll"/> |
50 | 55 | <security:intercept-url pattern="/manufacturer/**" access="permitAll"/> |
|
61 | 66 | <security:form-login |
62 | 67 | login-page="/login" |
63 | 68 | authentication-failure-url="/login?login_error=1" |
64 | | - authentication-success-handler-ref="populateBasketAfterLogin"/> |
| 69 | + authentication-success-handler-ref="populateBasketAfterLogin" |
| 70 | + login-processing-url="/j_spring_security_check"/> |
65 | 71 | <security:logout |
66 | 72 | logout-url="/j_spring_security_logout" |
67 | 73 | invalidate-session="true" delete-cookies="JSESSIONID" /> |
|
79 | 85 | <security:password-encoder hash="md5"/> |
80 | 86 | </security:authentication-provider> |
81 | 87 | </security:authentication-manager> |
82 | | - |
| 88 | + |
| 89 | + <security:global-method-security pre-post-annotations="enabled" /> |
| 90 | + |
83 | 91 | <bean id="authenticationFilterCustomer" |
84 | 92 | class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"> |
85 | 93 | <property name="authenticationManager" ref="authenticationManagerCustomer"/> |
86 | 94 | <property name="filterProcessesUrl" value="/j_spring_security_check"/> |
| 95 | + <property name="usernameParameter" value="j_username"/> |
| 96 | + <property name="passwordParameter" value="j_password"/> |
87 | 97 | </bean> |
88 | 98 |
|
89 | 99 | <bean id="authenticationFilterAdmin" |
90 | 100 | class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"> |
91 | 101 | <property name="authenticationManager" ref="authenticationManagerAdmin"/> |
92 | 102 | <property name="filterProcessesUrl" value="/admin/j_spring_security_check"/> |
| 103 | + <property name="usernameParameter" value="j_username"/> |
| 104 | + <property name="passwordParameter" value="j_password"/> |
93 | 105 | </bean> |
94 | 106 |
|
95 | 107 | </beans> |
|
0 commit comments