spring-projects / spring-projects/spring-security

Documentation has only an XML namespace introduction to eraseCredentialsAfterAuthentication

Open
#11,112 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: docs type: enhancement
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);
          }
}

Current Behavior

Context

No.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.