Closed
Description
Paul Benedict (Migrated from SEC-1783) said:
I need to record the number of password failures for existing users. DaoAuthenticationProvider#additionalAuthenticationChecks() is where I could do this, except BadCredentialsException is thrown for both (log messages) "no credentials provided" and "password does not match stored value". There's no way to distinguish the two at runtime. There's some refactoring here that could be done. Here are my suggestions:
- Subclass BadCredentialsException with new NoCredentialsException and InvalidCredentialsException
- Move the call to PasswordEncoder#isPasswordValid() to a new isPasswordValid() method whose default is to call the password encoder.
Of the two choices, I prefer #1