Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mitko Zafirovski
Liferay PwdEncryptor
July 9, 2012 9:15 AM
Answer

Mitko Zafirovski

Rank: Junior Member

Posts: 27

Join Date: March 1, 2012

Recent Posts

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
Mika Koivisto
RE: Liferay PwdEncryptor
July 9, 2012 2:04 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

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.
Jorge Omar Driesner
RE: Liferay PwdEncryptor
August 24, 2012 12:13 AM
Answer

Jorge Omar Driesner

Rank: New Member

Posts: 5

Join Date: April 20, 2009

Recent Posts

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.
Mika Koivisto
RE: Liferay PwdEncryptor
August 27, 2012 11:45 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

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.