我已創建其他身份驗證提供程序。我註冊他們如下:春季安全無法添加自定義身份驗證提供程序
@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預先感謝任何提示。最好的問候