Open edugreat opened 1 year ago
There may be a case of cyclic dependency after applying this change. To get around with that, I simply lazy load the bean AuthenticationManager
in the JwtService
using constructor injection.
@Autowired
public JwtService(/* other dependencies */ ,@Lazy AuthenticationManager authenticationManager) {
// Your code here
}
The spring core team has encouraged the use of component based configurations as extending
WebSecurityConfigurerAdapter
has been deprecated. Also@EnableGlobalMethodSecurity
has been replaced by@EnableMethodSecurity