Most likely, when you log in, events occur: this order:
- Spring selects an entity from the database by username.
- Spring should check the entered password to match the stored encoded password.
To verify compliance, Spring uses the PasswordEncoder , which you most likely configured.
Your password encoder expects the stored encoded password to be a hexadecimal char sequence (pre-encoded by this PasswordEncoder). Thus, it tries to decode CharSequence to byte [], but fails ( source ).
The solution is to save users with a previously encoded password, for example. by BCryptPasswordEncoder.
source share