我的WebSecurityConfig文件中有一个使用此方法的SpringBoot 2.1.4.RELEASE
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(userSecurityService)
.passwordEncoder(passwordEncoder());
}
我想在身份验证后从Authentication对象中清除凭据,
我将方法更改为
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(userSecurityService)
.eraseCredentials(false);
.passwordEncoder(passwordEncoder());
}
但是出现编译错误:
The method eraseCredentials(boolean) is undefined for the type DaoAuthenticationConfigurer<AuthenticationManagerBuilder,UserSecurityService>