Open
Description
AbstractUserDetailsAuthenticationProvider
catches UsernameNotFoundException
, but does not include it when throwing BadCredentialsException
.
Debugging would be improved if the stack trace included the original issue. This can be achieved by including the exception in the BadCredentialsException
construction:
// ...
} catch (UsernameNotFoundException ex) {
// ...
String message = this.messages
.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")
throw new BadCredentialsException(message, ex);
}