I am using Play 1.2.1. I want a hash password for my users. I thought it Crypto.passwordHashwould be good, but it is not. The passwordHash document says it returns an MD5 password hash. I created some user accounts in fixture where I put the md5 hash code:
...
User(admin):
login: admin
password: f1682b54de57d202ba947a0af26399fd
fullName: Administrator
...
The problem is that when I try to log in, something like this:
user.password.equals(Crypto.passwordHash(password))
and it does not work. So I put the log statement in my method autentify:
Logger.info("\nUser hashed password is %s " +
"\nPassed password is %s " +
"\nHashed passed password is %s",
user.password, password, Crypto.passwordHash(password));
And the password hashes are really different, but hey! The method output is passwordHashnot even an MD5 hash:
15:02:16,164 INFO ~
User hashed password is f1682b54de57d202ba947a0af26399fd
Passed password is <you don't have to know this :P>
Hashed passed password is 8WgrVN5X0gK6lHoK8mOZ/Q==
How about this? How to fix it? Or maybe I need to implement my own solution?