File tree Expand file tree Collapse file tree 2 files changed +0
-13
lines changed
java/org/springframework/security/config/annotation/web/configuration
resources/org/springframework/security/config/http Expand file tree Collapse file tree 2 files changed +0
-13
lines changed Original file line number Diff line number Diff line change 32
32
import org .springframework .security .config .test .SpringTestContextExtension ;
33
33
import org .springframework .security .web .DefaultSecurityFilterChain ;
34
34
import org .springframework .security .web .FilterChainProxy ;
35
- import org .springframework .security .web .csrf .CsrfTokenRepository ;
36
- import org .springframework .security .web .csrf .HttpSessionCsrfTokenRepository ;
37
35
38
36
import static org .mockito .ArgumentMatchers .anyBoolean ;
39
37
import static org .mockito .Mockito .never ;
@@ -78,17 +76,13 @@ Service service() {
78
76
79
77
@ Bean
80
78
DefaultSecurityFilterChain springSecurity (HttpSecurity http ) throws Exception {
81
- CsrfTokenRepository csrfRepository = new HttpSessionCsrfTokenRepository ();
82
79
// @formatter:off
83
80
http
84
81
.authorizeHttpRequests ((requests ) -> requests
85
82
.anyRequest ().permitAll ()
86
83
)
87
84
.sessionManagement ((sessions ) -> sessions
88
85
.requireExplicitAuthenticationStrategy (true )
89
- )
90
- .csrf ((csrf ) -> csrf
91
- .csrfTokenRepository (csrfRepository )
92
86
);
93
87
// @formatter:on
94
88
return http .build ();
Original file line number Diff line number Diff line change 29
29
<http auto-config =" true"
30
30
use-authorization-manager=" true" >
31
31
<intercept-url pattern =" /**" access =" permitAll" />
32
- <csrf token-repository-ref =" csrfRepository" />
33
32
<request-cache ref =" requestCache" />
34
33
<session-management authentication-strategy-explicit-invocation =" true" />
35
34
</http >
36
35
37
36
<b : bean id =" requestCache" class =" org.springframework.security.web.savedrequest.HttpSessionRequestCache"
38
37
p:matchingRequestParameterName=" continue" />
39
- <b : bean id =" httpSessionCsrfRepository" class =" org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository" />
40
- <b : bean id =" csrfRepository" class =" org.springframework.security.web.csrf.LazyCsrfTokenRepository"
41
- c:delegate-ref=" httpSessionCsrfRepository"
42
- p:deferLoadToken=" true" />
43
- <b : bean id =" requestHandler" class =" org.springframework.security.web.csrf.CsrfTokenRepositoryRequestHandler"
44
- p:csrfRequestAttributeName=" _csrf" />
45
38
<b : import resource =" CsrfConfigTests-shared-userservice.xml" />
46
39
</b : beans >
You can’t perform that action at this time.
0 commit comments