Retriving username and password from session in Liferay 6.2
String userName = null;
try {
userName = PortalUtil.getUser(httpRequest).getEmailAddress();
} catch (Exception e) {
System.out.println("Exception in retriving user name -> " + e.getMessage());
}
String password = null;
try {
password = (String)httpRequest.getSession().getAttribute(WebKeys.USER_PASSWORD);
} catch (Exception e) {
System.out.println("Exception in retriving password -> " + e.getMessage());
}
Note: Here for getting plain password we need to set below property in portal-ext.properties file.
session.store.password=true
Comments
Post a Comment