From 249610c7ed27d0940f3a8822020991aab967c0d1 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sat, 14 May 2011 11:57:30 +0100 Subject: [PATCH] SEC-1742: Remove deprecated "includeDetailsObject" field from DaoAuthenticationProvider. --- .../dao/DaoAuthenticationProvider.java | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java b/core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java index b628ef0234..aa918a5b14 100644 --- a/core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java +++ b/core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java @@ -28,8 +28,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.util.Assert; /** - * An {@link AuthenticationProvider} implementation that retrieves user details - * from an {@link UserDetailsService}. + * An {@link AuthenticationProvider} implementation that retrieves user details from a {@link UserDetailsService}. * * @author Ben Alex */ @@ -43,8 +42,6 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication private UserDetailsService userDetailsService; - private boolean includeDetailsObject = true; - //~ Methods ======================================================================================================== protected void additionalAuthenticationChecks(UserDetails userDetails, @@ -59,8 +56,7 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication logger.debug("Authentication failed: no credentials provided"); throw new BadCredentialsException(messages.getMessage( - "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), - includeDetailsObject ? userDetails : null); + "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), userDetails); } String presentedPassword = authentication.getCredentials().toString(); @@ -69,8 +65,7 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication logger.debug("Authentication failed: password does not match stored value"); throw new BadCredentialsException(messages.getMessage( - "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), - includeDetailsObject ? userDetails : null); + "AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), userDetails); } } @@ -170,20 +165,4 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication protected UserDetailsService getUserDetailsService() { return userDetailsService; } - - protected boolean isIncludeDetailsObject() { - return includeDetailsObject; - } - - /** - * Determines whether the UserDetails will be included in the extraInformation field of a - * thrown BadCredentialsException. Defaults to true, but can be set to false if the exception will be - * used with a remoting protocol, for example. - * - * @deprecated use {@link org.springframework.security.authentication.ProviderManager#setClearExtraInformation(boolean)} - */ - public void setIncludeDetailsObject(boolean includeDetailsObject) { - this.includeDetailsObject = includeDetailsObject; - } - }