ganwurrt
2020-07-20 22:53
采纳率: 100%
浏览 727
已采纳

springsecurity不执行userDetailsService中的loadUserByUsername

springboot1.0升级2.0后,原来的代码出现无法执行userDetailsService中的loadUserByUsername,查找一天无结果,有人遇到过嘛;
@Override
protected void configure(HttpSecurity http) throws Exception {

    http.addFilterAfter(validateCodeFilter, AbstractPreAuthenticatedProcessingFilter.class);

    http.authorizeRequests().anyRequest().fullyAuthenticated();
    http.formLogin().loginPage("/signin2").successHandler(myAuthenticationSuccessHandler)
            .failureHandler(myAuthenctiationFailureHandler);
    http.logout().permitAll();

    public void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题