The reactiveJwtSecurityFilterChain bean is initialised even if a custom SecurityWebFilterChain bean is registered.
The problem is that the ReactiveOAuth2ResourceServerWebSecurityAutoConfiguration configuration is annotated with ConditionalOnDefaultWebSecurity.
The ConditionalOnDefaultWebSecurity only handles the SERVLET application, but fails for REACTIVE.
The condition checks if a bean of type SecurityFilterChain is missing, but for the reactive stack, it must check for SecurityWebFilterChain
See
https://github.com/spring-projects/spring-boot/blame/699d9c34c3e2ead02b704dc7c1c1d1747684b99b/module/spring-boot-security-oauth2-resource-server/src/main/java/org/springframework/boot/security/oauth2/server/resource/autoconfigure/web/reactive/ReactiveOAuth2ResourceServerWebSecurityAutoConfiguration.java#L54
I assume a new ConditionalOnDefaultReactiveWebSecurity condition is required, or the existing ConditionalOnDefaultWebSecurity should cover both cases.
The
reactiveJwtSecurityFilterChainbean is initialised even if a customSecurityWebFilterChainbean is registered.The problem is that the
ReactiveOAuth2ResourceServerWebSecurityAutoConfigurationconfiguration is annotated withConditionalOnDefaultWebSecurity.The
ConditionalOnDefaultWebSecurityonly handles theSERVLETapplication, but fails forREACTIVE.The condition checks if a bean of type
SecurityFilterChainis missing, but for the reactive stack, it must check forSecurityWebFilterChainSee
https://github.com/spring-projects/spring-boot/blame/699d9c34c3e2ead02b704dc7c1c1d1747684b99b/module/spring-boot-security-oauth2-resource-server/src/main/java/org/springframework/boot/security/oauth2/server/resource/autoconfigure/web/reactive/ReactiveOAuth2ResourceServerWebSecurityAutoConfiguration.java#L54
I assume a new
ConditionalOnDefaultReactiveWebSecuritycondition is required, or the existingConditionalOnDefaultWebSecurityshould cover both cases.