我已创建其他身份验证提供程序。我注册他们如下:春季安全无法添加自定义身份验证提供程序
@Configuration
@EnableWebMvcSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
class SecurityConfig extends WebSecurityConfigurerAdapter{
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(tokenAP());
auth.authenticationProvider(usernameAndPasswordAP());
auth.userDetailsService(getUserDetailsService());
}
后来在我的代码我使用AuthenticationManager来认证用户。问题是我只有一个身份验证提供程序在身份验证管理器中注册,该身份验证提供程序是DaoAuthenticationProvider。它看起来像我的身份验证提供程序根本没有注册。我应该做一些额外的配置,使其工作?我正在使用弹簧启动1.2.6预先感谢任何提示。最好的问候