Spring Boot 3.2.0 Upgrade: "Authentication Manager Cannot Be Null" with RSocketSecurity

2k views Asked by At

I recently upgraded my Spring Boot application to version 3.2.0 (along with Spring Framework 6.1.1 and Spring Security 6.2.0). Post-upgrade, I am encountering an issue where the contextLoads() test cases alone fail with an error stating "authentication manager cannot be null". The application uses reactive RSocketSecurity with JwtReactiveAuthenticationManager.

Error: Caused by: java.lang.IllegalArgumentException: authenticationManager cannot be null

What I've Tried: Defining Beans: I ensured that MapReactiveUserDetailsService and ObservationReactiveAuthenticationManager beans are defined, as my application uses them.

Debugging Previous Version: I noticed that in Spring Boot 3.1.3, ReactiveAuthenticationManager was being created from the application context successfully, but this is not the case in 3.2.0.

Troubleshooting Steps: I've checked bean definitions, configuration order, component scanning, and even tried simplifying the security configuration, but the issue persists.

Expected behaviour: I'm looking for insights or suggestions on how to properly configure the ReactiveAuthenticationManager or any other necessary components in Spring Boot 3.2.0 to resolve the "authentication manager cannot be null" error. Any guidance on what might be missing or misconfigured in the context of the new Spring Boot version would be greatly appreciated.

1

There are 1 answers

0
Claas Wilke On

There is an open issue in the Spring Boot Project on GitHub that handles this bugs. It seems that there is a misconfiguration in the WebSecurityConfiguration configuration class (https://github.com/spring-projects/spring-boot/issues/38713).

The issue is tagged to be solved in Spring Boot 3.2.1 which will be released on 21st December 2023.