You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One: From the current Spring Security Reference Documentation, what is the official or recommended URL to use a tool to generate the hash password from a plain text password?
I am integrating
Spring Security
withBCrypt
.I have read many tutorials about the integration. Done
I use the: Bcrypt-Generator.com - Online Bcrypt Hash Generator & Checker
I did realize it always starts with
$2y
.But in testing I got errors and in runtime the login always fails. For both scenarios always appears the following:
WARN o.s.s.c.b.BCryptPasswordEncoder - Encoded password does not look like BCrypt
I did realize BCryptPasswordEncoder.java has the following method
Here three points:
logger.warn("Encoded password does not look like BCrypt");
matches
method. I am assumingSpring Security
does this internally or implicitlyif
statement where thewarn
is located usesBCRYPT_PATTERN
Ok,
BCRYPT_PATTERN
is:private Pattern BCRYPT_PATTERN = Pattern.compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}");
Until here it starts with
$2a?
, but the mine generated is$2y
. Thus always going to befalse
Now, If I use this BCrypt Calculator
I get
$2a
. Thus all work fine.One: From the current
Spring Security Reference Documentation
, what is the official or recommended URL to use a tool to generate thehash
password from a plain text password?Two: according with these links:
There are more
Algorithm Identifier
, such as:$2a
and$2y
, but theBCryptPasswordEncoder
class only works with one.According with the
StackOverflow
link,$2a
is weak and$2b
is the most better. Not sure what is the official home page forBCrypt
to confirm thisThe text was updated successfully, but these errors were encountered: