You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are migrating an application from spring boot 2.7.5 to 3.0, the application is failing to start with an error that says authenticationManager cannot be null. I noticed that this error is only reproducible when using the spring-boot-starter-actuator dependency with the spring-boot-starter-oauth2-resource-server dependency.
I did do some digging through the HttpSecurity class and I can see the error is coming from the beforeConfigure function. I noticed that in the beforeConfigure function, it's trying to get an AuthenticationManager but because we are using an AuthenticationManagerResolver it does not get one back and when it tries to create a new ObservationAuthenticationManager object it is failing in the constructor because the AuthenticationManager is null. Its was most likely introduced in this commit
To Reproduce
To reproduce you can clone the sample application I provided and run it in your favorite IDE.
Expected behavior
For the application to start successfully when the application is configured to use Oauth2 Resource Server along with spring boot actuator.
I feel that the HttpSecurity#beforeConfigure method should check if the AuthenticationManager created by the AuthenticationManagerBuilder is not null. I'll check with @jzheaux what he thinks about this.
Describe the bug
We are migrating an application from spring boot 2.7.5 to 3.0, the application is failing to start with an error that says
authenticationManager cannot be null
. I noticed that this error is only reproducible when using thespring-boot-starter-actuator
dependency with thespring-boot-starter-oauth2-resource-server
dependency.I did do some digging through the HttpSecurity class and I can see the error is coming from the beforeConfigure function. I noticed that in the beforeConfigure function, it's trying to get an AuthenticationManager but because we are using an AuthenticationManagerResolver it does not get one back and when it tries to create a new ObservationAuthenticationManager object it is failing in the constructor because the AuthenticationManager is null. Its was most likely introduced in this commit
To Reproduce
To reproduce you can clone the sample application I provided and run it in your favorite IDE.
Expected behavior
For the application to start successfully when the application is configured to use Oauth2 Resource Server along with spring boot actuator.
Sample
I cloned one of the spring security samples and made a few changes to mimic the application we are migrating.
You can find it [here](https://github.com/coderWhoMe/multi-tenancy-oauth)
https://github.com/coderWhoMe/multi-tenancy-oauth
The text was updated successfully, but these errors were encountered: