spring-projects / spring-projects/spring-security
Documentation has only an XML namespace introduction to eraseCredentialsAfterAuthentication
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Expected Behavior
In Spring Security 5.6.2, the process of configuring AuthenticationManagerBuilder.eraseCredentials(false); is relatively intuitive, but it does not correspond to https://docs.spring.io/spring-security/reference/servlet/configuration/java.html instruction of.
@Order(1)
@Configuration
public static class ApiWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
.httpBasic(withDefaults());
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.eraseCredentials(false);
}
}
- This problem extends to the documentation of
Spring Security 5.7.0-M3, and the lack of documentation brings more trouble to users, refer to https://docs.spring.io/spring-security/reference/5.7.0-M3/servlet/appendix/namespace/authentication-manager.html#nsa-authentication-manager-attributes . 
Current Behavior
- I think a simple example should be added at https://docs.spring.io/spring-security/reference/5.7.0-M3/servlet/configuration/java.html to modify eraseCredentialsAfterAuthentication .
Context
No.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the servlet Java configuration documentation at the referenced configuration/java.html page and compare it with the namespace authentication-manager documentation. Add a simple Java configuration example showing how to modify eraseCredentialsAfterAuthentication, then verify that the setting is explained consistently for the referenced Spring Security versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100