Foros de discusión

RE: Liferay 6.2 Password encryption

Ajit Rai, modificado hace 9 años.

Liferay 6.2 Password encryption

New Member Mensajes: 5 Fecha de incorporación: 11/09/13 Mensajes recientes
Dear Liferay Team,

We just have upgraded our application from liferay-portal-6.1.1-ce-ga2 to liferay-portal-6.2-ce-ga2 by using

passwords.encryption.algorithm.legacy=SHA we needed the old encryption to be used in our 6.2 installation as well.

Now the issue is coming during the password reset. When I reset the password using api
I create a random password and update the same using
UserLocalServiceUtil.updatePassword(user.getUserId(), temp_password, temp_password, true);
Which is using the code
PasswordEncryptorUtil.encrypt(password); to encrypt the password

for the same user it updates the user table with encrypted password using the under lying algorithm and send the same password to user's email .So far its fine

When again user try login using the changed password I am also using the same code to encrypt the password what user has got
but seems like the encryption is not able to generate the same encrypted key.

Encrypted password when system encrypts the password looks like : {PBKDF2WITHHMACSHA1}AAAAoAAB9ABvruUUTkGzDDPjH86WSOKPTto7sY5Itg9LjQFs
Which is by default the algorithm liferay 6.2 comes with
but when I try encrypting the same code it looks like :
nd0ratvUpyAEGhBgxIT7z2YWqIo=
due to my legacy setting on portal.ext ?

I am not sure if I already have set the legacy encryption why liferay is not able to use that instead of using the default encryption?

Please let me know if there is any thing which i am missing.

Thanks,
Ajit Rai
thumbnail
Alberto Chaparro, modificado hace 9 años.

RE: Liferay 6.2 Password encryption

Liferay Master Mensajes: 549 Fecha de incorporación: 25/04/11 Mensajes recientes
Hi Ajit,
Ajit Rai:
Dear Liferay Team,

We just have upgraded our application from liferay-portal-6.1.1-ce-ga2 to liferay-portal-6.2-ce-ga2 by using

passwords.encryption.algorithm.legacy=SHA we needed the old encryption to be used in our 6.2 installation as well.

If you want to keep the old encryption algorithm you just have to add the following property prior the upgrade:
passwords.encryption.algorithm=SHA

If you add the legacy property you are telling the portal that the previous algorithm was SHA and the new one is PBKDF2WithHmacSHA1/160/128000 (value by default for passwords.encryption.algorithm in 6.2) so the portal will execute the algorithm conversion.

So, please repeat the upgrade using the proper property.

Cheers.
Ajit Rai, modificado hace 9 años.

RE: Liferay 6.2 Password encryption

New Member Mensajes: 5 Fecha de incorporación: 11/09/13 Mensajes recientes
Got your point Alberto.Thanks for your quick help. emoticon
It should be documented as well in upgrade guide.