From b248eae416c46c29ca445248e090312a33880da8 Mon Sep 17 00:00:00 2001 From: hmolsen Date: Wed, 2 Mar 2016 20:39:28 +0100 Subject: [PATCH] Javadoc on ProviderManager.authenticate clarification Fixes gh-3722 --- .../security/authentication/ProviderManager.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java index 473436ac9f..7d6be070fd 100644 --- a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java +++ b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java @@ -136,9 +136,15 @@ public class ProviderManager implements AuthenticationManager, MessageSourceAwar * attempted with that AuthenticationProvider. *

* If more than one AuthenticationProvider supports the passed - * Authentication object, only the first - * AuthenticationProvider tried will determine the result. No subsequent - * AuthenticationProviders will be tried. + * Authentication object, the first one able to successfully + * authenticate the Authentication object determines the + * result, overriding any possible AuthenticationException + * thrown by earlier supporting AuthenticationProviders. + * On successful authentication, no subsequent AuthenticationProviders + * will be tried. + * If authentication was not successful by any supporting + * AuthenticationProvider the last thrown + * AuthenticationException will be rethrown. * * @param authentication the authentication request object. *