Smi*_*ise 3 java spring-security spring-boot
我使用 spring boot 2 + Spring Security 5。我不想在身份验证后删除凭据,所以我想eraseCredentialsAfterAuthentication = false在ProviderManger. 但我不知道如何在Spring Boot中配置它而不需要XML配置。
好吧,我知道了。只需在WebSecurityConfigurerAdapter.
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.eraseCredentials(false);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1508 次 |
| 最近记录: |