Ibm mobilefirst 无法从worklight client中的userIdentity对象检索属性
Iam使用worklight 6.0,我为适配器定制了securityTestIbm mobilefirst 无法从worklight client中的userIdentity对象检索属性,ibm-mobilefirst,worklight-security,Ibm Mobilefirst,Worklight Security,Iam使用worklight 6.0,我为适配器定制了securityTest In the loginModule, im adding few custom attributes for the userIdentity public UserIdentity createIdentity(String loginModule) { HashMap<String, Object> customAttributes = new HashMap<String,
In the loginModule, im adding few custom attributes for the userIdentity
public UserIdentity createIdentity(String loginModule) {
HashMap<String, Object> customAttributes = new HashMap<String, Object>();
customAttributes.put("AuthenticationDate", new Date());
customAttributes.put("userIdentity", USERIDENTITY);
UserIdentity identity = new UserIdentity("CustomAuthenticatorRealm", USERNAME, null, null, customAttributes, PASSWORD);
return identity;
}
In the client side,
var attrs = WL.Client.getUserInfo("CustomAuthenticatorRealm", "attributes");
Sometimes Iam getting the attributes and sometimes as null.
Please help me on this.
在loginModule中,我为userIdentity添加了一些自定义属性
公共用户标识createIdentity(字符串登录模块){
HashMap customAttributes=新建HashMap();
put(“AuthenticationDate”,new Date());
customAttributes.put(“userIdentity”,userIdentity);
UserIdentity=newuseridentity(“CustomAuthenticatorRealm”、用户名、null、null、customAttributes、密码);
返回身份;
}
在客户端,
var attrs=WL.Client.getUserInfo(“CustomAuthenticatorRealm”、“attributes”);
有时我得到属性,有时为空。
请帮我做这个。
成功验证后,用户身份属性将返回给客户端。如果您没有经历身份验证过程,您可以使用此API刷新用户数据-Iam正在经历身份验证过程。事件发生时,我无法检索属性变量