Description
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