0

我正在使用 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, 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.
4

1 回答 1

1

用户身份属性在认证成功后返回给客户端。如果您没有通过身份验证过程,您可以使用此 API 来刷新用户数据 - http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight .help.doc%2Fapiref%2Fr_wl_client_updateuserinfo.html

于 2014-01-09T11:34:58.927 回答