File tree Expand file tree Collapse file tree 9 files changed +12
-8
lines changed
spring-session-core/src/main/java/org/springframework/session/web/http
spring-session-docs/modules/ROOT/examples/java/docs/security
spring-session-sample-boot-findbyusername/src/main/java/sample/config
spring-session-sample-boot-hazelcast/src/main/java/sample/config
spring-session-sample-boot-jdbc/src/main/java/sample/config
spring-session-sample-boot-redis-json/src/main/java/sample/config
spring-session-sample-boot-redis/src/main/java/sample/config
spring-session-sample-boot-websocket/src/main/java/sample/config
spring-session-sample-javaconfig-rest/src/main/java/sample Expand file tree Collapse file tree 9 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public HeaderHttpSessionIdResolver(String headerName) {
98
98
@ Override
99
99
public List <String > resolveSessionIds (HttpServletRequest request ) {
100
100
String headerValue = request .getHeader (this .headerName );
101
+ System .out .println (headerValue );
101
102
return (headerValue != null ) ? Collections .singletonList (headerValue ) : Collections .emptyList ();
102
103
}
103
104
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
51
51
52
52
return http
53
53
.formLogin (Customizer .withDefaults ())
54
- .authorizeRequests ((authorize ) -> authorize
54
+ .authorizeHttpRequests ((authorize ) -> authorize
55
55
.anyRequest ().authenticated ()
56
56
).build ();
57
57
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class SecurityConfig {
36
36
@ Bean
37
37
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
38
38
return http
39
- .authorizeRequests ((authorize ) -> authorize
39
+ .authorizeHttpRequests ((authorize ) -> authorize
40
40
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
41
41
.anyRequest ().authenticated ()
42
42
)
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public class SecurityConfig {
35
35
@ Bean
36
36
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
37
37
return http
38
- .authorizeRequests ((authorize ) -> authorize
38
+ .authorizeHttpRequests ((authorize ) -> authorize
39
39
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
40
40
.anyRequest ().authenticated ()
41
41
)
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ WebSecurityCustomizer ignoringCustomizer() {
45
45
@ Bean
46
46
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
47
47
return http
48
- .authorizeRequests ((authorize ) -> authorize
48
+ .authorizeHttpRequests ((authorize ) -> authorize
49
49
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
50
50
.anyRequest ().authenticated ()
51
51
)
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public class SecurityConfig {
35
35
@ Bean
36
36
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
37
37
return http
38
- .authorizeRequests ((authorize ) -> authorize
38
+ .authorizeHttpRequests ((authorize ) -> authorize
39
39
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
40
40
.anyRequest ().authenticated ()
41
41
)
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class SecurityConfig {
36
36
@ Bean
37
37
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
38
38
return http
39
- .authorizeRequests ((authorize ) -> authorize
39
+ .authorizeHttpRequests ((authorize ) -> authorize
40
40
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
41
41
.anyRequest ().authenticated ()
42
42
)
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ WebSecurityCustomizer ignoringCustomizer() {
54
54
@ Bean
55
55
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
56
56
return http
57
- .authorizeRequests ((authorize ) -> authorize
57
+ .authorizeHttpRequests ((authorize ) -> authorize
58
58
.requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
59
59
.anyRequest ().authenticated ()
60
60
)
Original file line number Diff line number Diff line change 23
23
import org .springframework .security .config .annotation .authentication .builders .AuthenticationManagerBuilder ;
24
24
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
25
25
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
26
+ import org .springframework .security .config .http .SessionCreationPolicy ;
26
27
import org .springframework .security .core .userdetails .User ;
27
28
import org .springframework .security .web .SecurityFilterChain ;
28
29
import org .springframework .security .web .savedrequest .NullRequestCache ;
@@ -35,13 +36,15 @@ public class SecurityConfig {
35
36
@ Bean
36
37
SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
37
38
return http
38
- .authorizeRequests ((authorize ) -> authorize
39
+ .authorizeHttpRequests ((authorize ) -> authorize
39
40
.anyRequest ().authenticated ()
40
41
)
41
42
.requestCache ((requestCache ) -> requestCache
42
43
.requestCache (new NullRequestCache ())
43
44
)
44
45
.httpBasic (Customizer .withDefaults ())
46
+ .sessionManagement ((sessionManagement ) -> sessionManagement
47
+ .sessionCreationPolicy (SessionCreationPolicy .IF_REQUIRED ))
45
48
.build ();
46
49
}
47
50
// @formatter:on
You can’t perform that action at this time.
0 commit comments