Skip to content

ReactiveOAuth2ResourceServerWebSecurityAutoConfiguration annotated with wrong condition #50778

Description

@michael-wirth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: team-meetingAn issue we'd like to discuss as a team to make progresstype: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions