If you have enabled the Liferay account lock for wrong password in password policy then accidentally sometime admin account itself can be locked due to wrong password multiple attempts. And I feel in development phase it might happen so many times, and developer want to unlock the admin user. but without user credential who has the unlock user permission, you can’t go to the control panel to unlock the user.
These are the steps to unlock the user. this can be done through DB updation only.
Step 1. Stop the liferay Server if already running.
Step 2. open the DB console and run the query.
update user_ set lastfailedlogindate=null, failedloginattempts=0,
lockout=0, lockoutdate=null where emailaddress='test@liferay.com'
Step 3. start the server.
The same thing may happen for forgot password. if you have only one user Account with Administrator role and you forget the password of that account then you cannot do any modification in the portal like page creation deletion, portlet placement etc.
There is no way to recover the password because liferay DB stores the password in encrypted format. but we can change the password directly in the DB,
Steps:
Step 1. Stop the Liferay Server if running.
Step 2. open the DB console and run the query.
update user_ set password_='newpassword', passwordencrypted=0
where emailaddress='test@liferay.com'
Step 3. start the Server.
If you have both the condition eg. you have forgot the Administrator password and after so many attempts your account is also locked then you need to run both the queries in your DB. or run a single query below.
update user_ set password_='newpassword', passwordencrypted=0,
lastfailedlogindate=null, failedloginattempts=0, lockout=0,
lockoutdate=null where emailaddress='test@liferay.com'
Thanks
The post Liferay Tips and Tricks for accidentally locked and forgot password of Admin account appeared first on CodingLoading.