WebSecurityConfigurerAdapter实现中注册:
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
AuthorizationServerConfigurerAdapter中实现:
@Autowired
private AuthenticationManager authenticationManager;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints)
throws Exception
{
endpoints.authenticationManager(authenticationManager);
}