SEC-678: Moved extraInformation property to AuthenticationException so ti isn't only available in BadCredentialsException. Added clearExtraInformation flag to AbstractAuthenticationManager to allow the information to be removed if required before rethrowing.
@ -42,6 +46,11 @@ public abstract class AbstractAuthenticationManager implements AuthenticationMan
@@ -42,6 +46,11 @@ public abstract class AbstractAuthenticationManager implements AuthenticationMan
returndoAuthentication(authRequest);
}catch(AuthenticationExceptione){
e.setAuthentication(authRequest);
if(clearExtraInformation){
e.clearExtraInformation();
}
throwe;
}
}
@ -59,4 +68,15 @@ public abstract class AbstractAuthenticationManager implements AuthenticationMan
@@ -59,4 +68,15 @@ public abstract class AbstractAuthenticationManager implements AuthenticationMan
@ -45,4 +45,8 @@ public class AccountExpiredException extends AccountStatusException {
@@ -45,4 +45,8 @@ public class AccountExpiredException extends AccountStatusException {
@ -40,8 +36,7 @@ public class BadCredentialsException extends AuthenticationException {
@@ -40,8 +36,7 @@ public class BadCredentialsException extends AuthenticationException {
@ -57,12 +52,4 @@ public class BadCredentialsException extends AuthenticationException {
@@ -57,12 +52,4 @@ public class BadCredentialsException extends AuthenticationException {
@ -45,4 +45,8 @@ public class CredentialsExpiredException extends AccountStatusException {
@@ -45,4 +45,8 @@ public class CredentialsExpiredException extends AccountStatusException {
@ -44,4 +44,8 @@ public class DisabledException extends AccountStatusException {
@@ -44,4 +44,8 @@ public class DisabledException extends AccountStatusException {
@ -44,4 +44,8 @@ public class LockedException extends AccountStatusException {
@@ -44,4 +44,8 @@ public class LockedException extends AccountStatusException {
@ -269,6 +269,12 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@@ -269,6 +269,12 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@ -285,19 +291,18 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@@ -285,19 +291,18 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@ -305,9 +310,9 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@@ -305,9 +310,9 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe
@ -130,10 +130,17 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
@@ -130,10 +130,17 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
@ -19,21 +19,21 @@ public class AccountStatusUserDetailsChecker implements UserDetailsChecker {
@@ -19,21 +19,21 @@ public class AccountStatusUserDetailsChecker implements UserDetailsChecker {
publicvoidcheck(UserDetailsuser){
if(!user.isAccountNonLocked()){
thrownewLockedException(messages.getMessage("UserDetailsService.locked","User account is locked"));
thrownewLockedException(messages.getMessage("UserDetailsService.locked","User account is locked"),user);
}
if(!user.isEnabled()){
thrownewDisabledException(messages.getMessage("UserDetailsService.disabled","User is disabled"));
thrownewDisabledException(messages.getMessage("UserDetailsService.disabled","User is disabled"),user);