Skip to content

ServerHttpSecurityConfiguration creates a circular dependency with WebFluxConfigurationSupport #10076

Closed
@wilkinsona

Description

@wilkinsona

Describe the bug

ServerHttpSecurityConfiguration defines a WebFluxConfigurer bean while also injecting a ReactiveAdapterRegistry. The ReactiveAdapterRegistry is defined by WebFluxConfigurationSupport but WebFluxConfigurationSupport also needs to be initialized with every WebFluxConfigurer bean. This creates a cycle between the two configuration classes. Framework is able to mask this cycle when the bean factory is configured to allow circular references. When circular references are prohibited, application context refresh fails with a BeanCurrentlyInCreationException.

To Reproduce

Run that attached sample with ./gradlew bootRun or import it into your IDE and run the main method.

Expected behavior

Spring Security can be used with WebFlux when the bean factory is configured to prohibit circular references.

Sample

webflux-security-dependency-cycle.zip

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions