2014-01-09 1 views
0

Iam, использующий worklight 6.0, и у меня есть специальный тест безопасности для адаптера.Невозможно получить атрибуты из объекта userIdentity в клиенте worklight

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. 

ответ

1

Атрибуты идентификации пользователя возвращаются клиенту после успешной аутентификации. Если вы не проходите процесс аутентификации, вы можете использовать этот API для обновления пользовательских данных. http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fapiref%2Fr_wl_client_updateuserinfo.html

+0

Iam, проходящий процесс аутентификации. eventhen, im не удалось получить attrs var – user2967626

Смежные вопросы