Posts

Showing posts with the label password

Disabling the Change of password for the user

If we want to disable the change of the password when user is logging into first time, we can follow these 2 steps 1. When the user is creating the my code, i mean if we have written the code for adding the user instead of out of box. then we can set like this . user.setPasswordReset(false); UserLocalServiceUtil.updateUser(user); 2. I think this option we be better, Go to the controlPanel Control Panel -> Password Policies(Portal Section) -> Default Password Policy .-> Change Required (uncheck checkbox). That's it , when user is logging first time, then we cannot get change password screen.

Getting the user password

In Liferay, We know that user password stores in Encrypted format in DB but sometime we have want to know the user password. so what to do?? We have utility method portalUtil.getUserPassword(portalRequest); But it gives null value. So how do we get it? Add the following properties in the Portal-ext.properties and restart the server. session.store.password=true session.shared.attributes.excludes= Then use the portalUtil.getPassword to get the userPassword. Thats it!!!  Now we can view the user password.

Reteriving guest premissions for the login portlet

  Some times unknowingly admin  may remove the guest permissions for the login portlet and when we try to access the portlet it says "you do not have permission to view the portlet" . Then we have to retrive back the permisions but portlet is not accessiable  what to do! Here we go , Add the following properties in portal-ext.properties  auto.login.hooks=com.liferay.portal.security.auth.ParameterAutoLogin , Whenever we add parameter in portal-ext.properties we need to resart the server. Access the url as follows  http://localhost:8080/c/portal/login?parameterAutoLoginLogin=yourscreennameOrEmailAddress&parameterAutoLoginPassword=password Retrieve back the permission changes and remove the auto.login.hooks from the portal-ext.properties. Thats it you have done and you will able to see the login portlet