Hi,
I wrote a custom Liferay Authentication Module which authenticates a user against my own Backend-DB.
If the login is successful it creates the user in Liferay (if it doesn't already exists in Liferay DB ). For the case the user already exists in Liferay DB I perform an update of the Liferay User instead via calling UserLocalServiceUtil.updateUser(User user).
Here the relevant Code-Snippet:
1
2//Use Case: User already exists in Liferay
3//get current Liferay user
4User user = UserLocalServiceUtil.getUserByScreenName(companyId,screenName);
5//set new user credentials
6user.setFirstName(newFirstName);
7user.setLastName(newLastName);
8user.setEmailAddress(newEmailAddress);
9//Update user in Liferay
10UserLocalServiceUtil.updateUser(user);
Unfortunately after the user update the changes are not visible in the "My Account"-Portlet. There I see the old values (values before update).
However if I read out the user programmatically via
"UserLocalServiceUtil.getUserByScreenName(companyId,screenName)" I get the updated values.
Any suggestions about the cause of this behavior?
Thx a lot in advance.