File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
config/src/main/java/org/springframework/security/config/annotation/web/reactive Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 43
43
import org .springframework .web .reactive .config .WebFluxConfigurer ;
44
44
import org .springframework .web .reactive .result .method .annotation .ArgumentResolverConfigurer ;
45
45
46
+ import static org .springframework .security .config .Customizer .withDefaults ;
47
+
46
48
/**
47
49
* @author Rob Winch
48
50
* @author Dan Zheng
@@ -156,8 +158,8 @@ ServerHttpSecurity httpSecurity() {
156
158
ContextAwareServerHttpSecurity http = new ContextAwareServerHttpSecurity ();
157
159
// @formatter:off
158
160
return http .authenticationManager (authenticationManager ())
159
- .headers (). and ( )
160
- .logout (). and ( );
161
+ .headers (withDefaults () )
162
+ .logout (withDefaults () );
161
163
// @formatter:on
162
164
}
163
165
Original file line number Diff line number Diff line change 40
40
import org .springframework .util .ObjectUtils ;
41
41
import org .springframework .web .reactive .result .view .AbstractView ;
42
42
43
+ import static org .springframework .security .config .Customizer .withDefaults ;
44
+
43
45
/**
44
46
* @author Rob Winch
45
47
* @since 5.0
@@ -121,13 +123,13 @@ private SecurityWebFilterChain springSecurityFilterChain() {
121
123
* @return
122
124
*/
123
125
private SecurityWebFilterChain springSecurityFilterChain (ServerHttpSecurity http ) {
124
- http .authorizeExchange () .anyExchange ().authenticated ();
126
+ http .authorizeExchange (( exchange ) -> exchange .anyExchange ().authenticated () );
125
127
if (isOAuth2Present && OAuth2ClasspathGuard .shouldConfigure (this .context )) {
126
128
OAuth2ClasspathGuard .configure (this .context , http );
127
129
}
128
130
else {
129
- http .httpBasic ();
130
- http .formLogin ();
131
+ http .httpBasic (withDefaults () );
132
+ http .formLogin (withDefaults () );
131
133
}
132
134
SecurityWebFilterChain result = http .build ();
133
135
return result ;
@@ -136,8 +138,8 @@ private SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http
136
138
private static class OAuth2ClasspathGuard {
137
139
138
140
static void configure (ApplicationContext context , ServerHttpSecurity http ) {
139
- http .oauth2Login ();
140
- http .oauth2Client ();
141
+ http .oauth2Login (withDefaults () );
142
+ http .oauth2Client (withDefaults () );
141
143
}
142
144
143
145
static boolean shouldConfigure (ApplicationContext context ) {
You can’t perform that action at this time.
0 commit comments