问题
With the help of the following API calls,
1. WL.Server.setActiveUser
2. WL.Server.getCurrentUserIdentity
We can create user session and get the user identity properties respectively.
I have a scenario where I want to update the properties[custom attributes] in the user identity object when the session is active.
I couldn't find an API which can do this task.
Is there any way/work-around available.
回答1:
In general activated userIdentity is immutable. Try this, it might work
var userIdentity = WL.Server.getActiveUser("realm");
userIdentity[propName] = newValue;
WL.Server.setActiveUser("realm", null);
WL.Server.setActiveUser("realm", userIdentity);
来源:https://stackoverflow.com/questions/29301167/ibm-mobilefirst-platform-foundation-6-3-can-we-edit-the-custom-attributes-of-us