Fórumok

Liferay PwdEncryptor

Mitko Zafirovski, módosítva 11 év-val korábban

Liferay PwdEncryptor

Junior Member Bejegyzések: 26 Csatlakozás dátuma: 2012.03.01. Legújabb bejegyzések
Hello all.

I want to make a custom change password feature that wont be used from the my account portlet of liferay but from my own custom portlet. Now i did this feature by using
UserLocalServiceUtil.updatePassword(userId,password1,password2,silentUpdate);

and checking for the old password by allowing the password to be stored in the session. At the moment i have implemented a SSO using a CAS server. When the user is logged in from the CAS server the password is not stored in the session. This is ok, because storing the password in the session did not sound as a good solution from the beginning but now i have the problem of comparing the current password the user enters. There is no liferay method that requires the current password to compare it with the one in the DB( at least i was not able to find that action). I tried using the PwdEncryptor.encrypt(pwd) to encrypt the user type password and compare thouse two password but this did not work. Because i constantly get:
java.lang.NoClassDefFoundError: com/liferay/portal/security/pwd/PwdEncryptor


I tried importing it didnt work. Also tried using reflection to get the class, but it still did not work. Is there anyway to get access to this class.

From the liferay source i saw that in the my-account portlet they use the PwdAuthenticator.authenticate() method to check if the provided current password matches the one stored in the DB. But i have the same problem as PwdEncryptor. Can someone please help me. Any suggestion would be very appreciated.

Regards, Mitko
thumbnail
Mika Koivisto, módosítva 11 év-val korábban

RE: Liferay PwdEncryptor

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
PwdEncryptor is in portal-impl.jar so it's not visible to plugins. What you could use is PortalClassInvoker to invoke it. If you need example check out com.liferay.portal.kernel.struts.PortletActionInvoker class.
thumbnail
Jorge Omar Driesner, módosítva 11 év-val korábban

RE: Liferay PwdEncryptor

New Member Bejegyzések: 5 Csatlakozás dátuma: 2009.04.20. Legújabb bejegyzések
Mika Koivisto:
PwdEncryptor is in portal-impl.jar so it's not visible to plugins. What you could use is PortalClassInvoker to invoke it. If you need example check out com.liferay.portal.kernel.struts.PortletActionInvoker class.


Hi Mika,

This feature open a wide range of posibilities to me, so I would ask you if the PortalClassInvoker will still be available in the future releases of the Portal?

Regards.
thumbnail
Mika Koivisto, módosítva 11 év-val korábban

RE: Liferay PwdEncryptor

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
I believe it is but it's usage maybe limited for plugins when PACL is enabled. All marketplace plugins must be designed with that in mind.