Spring Boot 4.1.0 conditions to apply ReactiveOAuth2ResourceServerAutoConfiguration have changed, making it possible to try to instantiate a SpringReactiveOpaqueTokenIntrospector, even if WebFlux dependencies are not on the classpath.
In my case, this results in java.lang.ClassNotFoundException: org.springframework.web.reactive.function.BodyInserter.
The following tests for tiny WebMvc applications with introspection properties crash:
git clone https://github.com/ch4mpy/spring-addons.git
cd spring-addons
git checkout boot-4.1.0
mvn test
Thoughts
Conditions for Boot to auto-configure beans should be quite conservative. In the case of an opaque token introspector, this should happen only if:
- introspection properties are present
- the required security dependencies are on the classpath
- there is no opaque token introspector provided by the application (
@ConditionalOnMissingBean).
Additionally, depending on what is on the classpath, at most one of the reactive or synchronized implementations should be instantiated.
Spring Boot
4.1.0conditions to applyReactiveOAuth2ResourceServerAutoConfigurationhave changed, making it possible to try to instantiate aSpringReactiveOpaqueTokenIntrospector, even if WebFlux dependencies are not on the classpath.In my case, this results in
java.lang.ClassNotFoundException: org.springframework.web.reactive.function.BodyInserter.The following tests for tiny WebMvc applications with introspection properties crash:
Thoughts
Conditions for Boot to auto-configure beans should be quite conservative. In the case of an opaque token introspector, this should happen only if:
@ConditionalOnMissingBean).Additionally, depending on what is on the classpath, at most one of the reactive or synchronized implementations should be instantiated.