Hello All,
Firstly, I log in to Gatein as admin, and then in my program and try to get my user detail. I am able to retrieve the user ( org.exoplatform.services.organization.User) details and print the firstName, lastName, userName values but password is always null.
Here is my code for retrieving Gatein User
protected User getPortletUser() {
User portletUser = null;
try{
PortalRequestContext context = PortalRequestContext.getCurrentInstance();
// Get the logon user
String remoteUserName = context.getRemoteUser();
PortalContainer portalContainer = PortalContainer.getInstance();
OrganizationService orgService= (OrganizationService) portalContainer.getComponentInstanceOfType(OrganizationService.class);
if (remoteUserName != null) {
portletUser = orgService.getUserHandler().findUserByName(remoteUserName);
ValidatorUtils.isNotNull(portletUser, "Could not load portlet user details for " + remoteUserName);
}
} catch (Exception e) {}
return portletUser;
}
Thanks for your help.
the answer could be in https://jira.jboss.org/browse/GTNPORTAL-306