dreezey / argon2-password-hash-provider

Argon2 Password Hash Provider for Keycloak
Apache License 2.0
25 stars 16 forks source link

Do not assume `argon2` based hashes #4

Closed RobertHeim closed 3 years ago

RobertHeim commented 3 years ago

The extractArgon2ParametersFromEncodedPassword assumes argon2 based hashes and hence fails with an "Index out of bound" exception if the hash does not include a $ sign. The introduced test checks this assumption to short cut testing the policy. If the stored hash is not an argon2-hash than the policy is violated and a rehash is required.

see #3

dreezey commented 3 years ago

@RobertHeim code changes look good, just tested this and Keycloak is now able to migrate to this hashing algorithm transparently as expected, thanks!