Skip to content

Commit 2cdf801

Browse files
committed
Add a note to the docs about combining multiple security components
Previously, the documentation did not describe how to combine multiple security components when one component's WebSecurityConfigurerAdapter or SecurityWebFilterChain would cause the other components' beans of the same type to back off. This commit adds a note that such cases should be handled by the user defining their own WebSecurityConfigurerAdapter or SecurityWebFilterChain that configures the use of all of the components as required. Closes gh-18507
1 parent 1529ba1 commit 2cdf801

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,7 +3064,7 @@ You can provide a different `AuthenticationEventPublisher` by adding a bean for
30643064
=== MVC Security
30653065
The default security configuration is implemented in `SecurityAutoConfiguration` and `UserDetailsServiceAutoConfiguration`.
30663066
`SecurityAutoConfiguration` imports `SpringBootWebSecurityConfiguration` for web security and `UserDetailsServiceAutoConfiguration` configures authentication, which is also relevant in non-web applications.
3067-
To switch off the default web application security configuration completely, you can add a bean of type `WebSecurityConfigurerAdapter` (doing so does not disable the `UserDetailsService` configuration or Actuator's security).
3067+
To switch off the default web application security configuration completely or to combine multiple Spring Security components such as OAuth 2 Client and Resource Server, add a bean of type `WebSecurityConfigurerAdapter` (doing so does not disable the `UserDetailsService` configuration or Actuator's security).
30683068

30693069
To also switch off the `UserDetailsService` configuration, you can add a bean of type `UserDetailsService`, `AuthenticationProvider`, or `AuthenticationManager`.
30703070

@@ -3084,7 +3084,7 @@ To switch off the default web application security configuration completely, you
30843084

30853085
To also switch off the `UserDetailsService` configuration, you can add a bean of type `ReactiveUserDetailsService` or `ReactiveAuthenticationManager`.
30863086

3087-
Access rules can be configured by adding a custom `SecurityWebFilterChain`.
3087+
Access rules and the use of multiple Spring Security components such as OAuth 2 Client and Resource Server can be configured by adding a custom `SecurityWebFilterChain` bean.
30883088
Spring Boot provides convenience methods that can be used to override access rules for actuator endpoints and static resources.
30893089
`EndpointRequest` can be used to create a `ServerWebExchangeMatcher` that is based on the configprop:management.endpoints.web.base-path[] property.
30903090

0 commit comments

Comments
 (0)