@Bean of AuthenticationManager from WebSecurityConfigurerAdapter throws either StackOverflowError or OutOfMemoryError #10477
Labels
in: core
An issue in spring-security-core
status: duplicate
A duplicate of another issue
type: bug
A general bug
Describe the bug
I'm overriding the authenticationManager method from the WebSecurityConfigurerAdapter in order to create its bean, howerver whenever I try to turn the spring context up (in a test annotated with a @SpringBootTest for example), I get either a StackOverflowError or OutOfMemoryError. I tracked this error to the authenticationManager method, because whenever I remove the @bean annotation the error disappears.
I'm using gradle, Java 11 and spring-boot-starter-security version 2.5.6
To Reproduce
Expected behavior
Being able to run the app and inject the authenticationManager bean
Sample
https://github.com/mmorillodev/stackoverflow-error-sample
The text was updated successfully, but these errors were encountered: