IBM MobileFirst Platform Foundation 6.3: Can we edit the custom attributes of User Identity Object [MobileFirst Session]

送分小仙女□ 提交于 2020-01-06 02:33:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!