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 4343import org .springframework .web .reactive .config .WebFluxConfigurer ;
4444import org .springframework .web .reactive .result .method .annotation .ArgumentResolverConfigurer ;
4545
46+ import static org .springframework .security .config .Customizer .withDefaults ;
47+
4648/**
4749 * @author Rob Winch
4850 * @author Dan Zheng
@@ -156,8 +158,8 @@ ServerHttpSecurity httpSecurity() {
156158 ContextAwareServerHttpSecurity http = new ContextAwareServerHttpSecurity ();
157159 // @formatter:off
158160 return http .authenticationManager (authenticationManager ())
159- .headers (). and ( )
160- .logout (). and ( );
161+ .headers (withDefaults () )
162+ .logout (withDefaults () );
161163 // @formatter:on
162164 }
163165
Original file line number Diff line number Diff line change 4040import org .springframework .util .ObjectUtils ;
4141import org .springframework .web .reactive .result .view .AbstractView ;
4242
43+ import static org .springframework .security .config .Customizer .withDefaults ;
44+
4345/**
4446 * @author Rob Winch
4547 * @since 5.0
@@ -121,13 +123,13 @@ private SecurityWebFilterChain springSecurityFilterChain() {
121123 * @return
122124 */
123125 private SecurityWebFilterChain springSecurityFilterChain (ServerHttpSecurity http ) {
124- http .authorizeExchange () .anyExchange ().authenticated ();
126+ http .authorizeExchange (( exchange ) -> exchange .anyExchange ().authenticated () );
125127 if (isOAuth2Present && OAuth2ClasspathGuard .shouldConfigure (this .context )) {
126128 OAuth2ClasspathGuard .configure (this .context , http );
127129 }
128130 else {
129- http .httpBasic ();
130- http .formLogin ();
131+ http .httpBasic (withDefaults () );
132+ http .formLogin (withDefaults () );
131133 }
132134 SecurityWebFilterChain result = http .build ();
133135 return result ;
@@ -136,8 +138,8 @@ private SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http
136138 private static class OAuth2ClasspathGuard {
137139
138140 static void configure (ApplicationContext context , ServerHttpSecurity http ) {
139- http .oauth2Login ();
140- http .oauth2Client ();
141+ http .oauth2Login (withDefaults () );
142+ http .oauth2Client (withDefaults () );
141143 }
142144
143145 static boolean shouldConfigure (ApplicationContext context ) {
You can’t perform that action at this time.
0 commit comments