IBM MobileFirst Platform Foundation 6.3: Can we ed

2019-08-05 17:54发布

问题:

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);