Could not Autowire.No Beans of UserDetailService type found
Description: Field userDetailsService in com.word.security.WebSecurityConfig required a bean of type 'org.springframework.security.core.userdetails.UserDetailsService' that could not be found. Action: Consider defining a bean of type 'org.springframework.security.core.userdetails.UserDetailsService' in your configuration.
Override this method to expose a UserDetailsService created from
configure(AuthenticationManagerBuilder) as a bean. So try to override
this method in WebSecurityConfig like this:
@Bean
public UserDetailsService userDetailsService() {
return super.userDetailsService();
}