mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-11 21:03:31 +00:00
SEC-1742: Remove deprecated "includeDetailsObject" field from DaoAuthenticationProvider.
This commit is contained in:
parent
1976cb1bf7
commit
249610c7ed
@ -28,8 +28,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link AuthenticationProvider} implementation that retrieves user details
|
* An {@link AuthenticationProvider} implementation that retrieves user details from a {@link UserDetailsService}.
|
||||||
* from an {@link UserDetailsService}.
|
|
||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
*/
|
*/
|
||||||
@ -43,8 +42,6 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
|
|||||||
|
|
||||||
private UserDetailsService userDetailsService;
|
private UserDetailsService userDetailsService;
|
||||||
|
|
||||||
private boolean includeDetailsObject = true;
|
|
||||||
|
|
||||||
//~ Methods ========================================================================================================
|
//~ Methods ========================================================================================================
|
||||||
|
|
||||||
protected void additionalAuthenticationChecks(UserDetails userDetails,
|
protected void additionalAuthenticationChecks(UserDetails userDetails,
|
||||||
@ -59,8 +56,7 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
|
|||||||
logger.debug("Authentication failed: no credentials provided");
|
logger.debug("Authentication failed: no credentials provided");
|
||||||
|
|
||||||
throw new BadCredentialsException(messages.getMessage(
|
throw new BadCredentialsException(messages.getMessage(
|
||||||
"AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"),
|
"AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), userDetails);
|
||||||
includeDetailsObject ? userDetails : null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String presentedPassword = authentication.getCredentials().toString();
|
String presentedPassword = authentication.getCredentials().toString();
|
||||||
@ -69,8 +65,7 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
|
|||||||
logger.debug("Authentication failed: password does not match stored value");
|
logger.debug("Authentication failed: password does not match stored value");
|
||||||
|
|
||||||
throw new BadCredentialsException(messages.getMessage(
|
throw new BadCredentialsException(messages.getMessage(
|
||||||
"AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"),
|
"AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), userDetails);
|
||||||
includeDetailsObject ? userDetails : null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,20 +165,4 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
|
|||||||
protected UserDetailsService getUserDetailsService() {
|
protected UserDetailsService getUserDetailsService() {
|
||||||
return userDetailsService;
|
return userDetailsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isIncludeDetailsObject() {
|
|
||||||
return includeDetailsObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines whether the UserDetails will be included in the <tt>extraInformation</tt> 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user