Springboot 3.0.0-M2 AuthenticationManager

Viewed 127

I wanted to create a backend using spring boot. When I executed the application, this exception was thrown:

Field authenticationManager in projekt.controller.AuthController required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.

I quickly found a solution on the internet, which includes adding a WebSecurityConfigurerAdapter in which I would add this method:

@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
    return super.authenticationManagerBean();
}

But as I had to see, this is deprecated.

My question is how would I do the same thing without using something deprecated.

0 Answers
Related