config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java
public AuthenticationManagerBuilder parentAuthenticationManager(
			AuthenticationManager authenticationManager) {
		if (authenticationManager instanceof ProviderManager) {
			eraseCredentials(((ProviderManager) authenticationManager)
					.isEraseCredentialsAfterAuthentication());
		}
		this.parentAuthenticationManager = authenticationManager;
		return this;
	}
public AuthenticationManagerBuilder parentAuthenticationManager(
			AuthenticationManager authenticationManager) {
		if (authenticationManager instanceof ProviderManager) {
			eraseCredentials(((ProviderManager) authenticationManager)
					.isEraseCredentialsAfterAuthentication());
		}
		this.parentAuthenticationManager = authenticationManager;
		return this;
	}
Allows providing a parent {@link AuthenticationManager} that will be tried if this
{@link AuthenticationManager} was unable to attempt to authenticate the provided
{@link Authentication}.

@param authenticationManager the {@link AuthenticationManager} that should be used
if the current {@link AuthenticationManager} was unable to attempt to authenticate
the provided {@link Authentication}.
@return the {@link AuthenticationManagerBuilder} for further adding types of
authentication