diff --git a/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java index 3bf07696685..b05f831ee95 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java @@ -200,17 +200,20 @@ public LdapAuthenticationProviderConfigurer ldapAu } /** - * Add authentication based upon the custom {@link AuthenticationProvider} that is - * passed in. Since the {@link AuthenticationProvider} implementation is unknown, all + * Adds the custom {@link AuthenticationProvider} to the list of providers. This + * method does not replace existing providers. it appends the new provider to the + * internal collection. + *

+ * Since the {@link AuthenticationProvider} implementation is unknown, all * customizations must be done externally and the {@link AuthenticationManagerBuilder} * is returned immediately. - * *

* This method does NOT ensure that the {@link UserDetailsService} is available * for the {@link #getDefaultUserDetailsService()} method. - * + *

* Note that an {@link Exception} might be thrown if an error occurs when adding the * {@link AuthenticationProvider}. + * @param authenticationProvider the {@link AuthenticationProvider} to add * @return a {@link AuthenticationManagerBuilder} to allow further authentication to * be provided to the {@link AuthenticationManagerBuilder} */