Environment:
I have 2 authentication providers - one that hits ActiveDirectory, and then one that hi
I had the same problem, this was the solution for me:
@Override
protected void configure(AuthenticationManagerBuilder
authManagerBuilder) throws Exception {
...
.userDetailsService(userDetailsService());
...
}
The problem where the brackets after userDetailsService - removed them and it works as expected. From your code snippet I can't be sure where you get the userDetailsService from, for me I had it @Autowired.
I had the same problem and another solution worked in my case. The difference is, that I had simply username and password, database authentication.
@Override
protected void configure(AuthenticationManagerBuilder authManagerBuilder) throws Exception {
authManagerBuilder
.userDetailsService(userDetailsService())
.passwordEncoder(passwordEncoder());
}
@Bean
UserDetailsService userDetailsService() {
return new UserDetailsService();
}
The fix was to add the @Override
annotation to the @Bean
annotated method:
@Bean
@Override
UserDetailsService userDetailsService() {
return new UserDetailsService();
}