szerhusenBC/jwt-spring-security-demo

Encoded password does not look like BCrypt

qamalyanaren opened this issue · 2 comments

I create register controller

I use user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));

When login get above error

what's the password you set to UserDetails?
BCryptPasswordEncoder will call a pattern.matches first before verify the password
The pattern is \A\$2a?\$\d\d\$[./0-9A-Za-z]{53}
hashed password should like $2a$10$9Co6Sm0piVTUn8DVuZFH8.YLj10BS1eHPnDLAHqhff0CsQXCxP4Dq

Closed, because I published a complete new version.