Ibm mobilefirst Can';无法检索用户角色

Ibm mobilefirst Can';无法检索用户角色,ibm-mobilefirst,worklight-security,Ibm Mobilefirst,Worklight Security,我正在尝试将角色列表从WL服务器返回到移动客户端设备 在LoginModule的createIdentity方法中,我添加了以下代码 HashMap<String, Object> customAttributes = new HashMap<String, Object>(); customAttributes.put("AuthenticationDate", new Date()); Set<String> groups = new HashSet&l

我正在尝试将角色列表从WL服务器返回到移动客户端设备

在LoginModule的createIdentity方法中,我添加了以下代码

HashMap<String, Object> customAttributes = new HashMap<String, Object>();
customAttributes.put("AuthenticationDate", new Date());

Set<String> groups = new HashSet<String>();
groups.add("Managers");
groups.add("Users");

UserIdentity identity = new UserIdentity(loginModule, USERNAME, "Fred Flintstone", groups, customAttributes, PASSWORD);
HashMap customAttributes=newhashmap();
put(“AuthenticationDate”,new Date());
Set groups=newhashset();
集团。添加(“经理”);
组。添加(“用户”);
UserIdentity=newuseridentity(登录模块、用户名、“Fred Flintstone”、组、customAttributes、密码);
显示名“Fred Flintstone”返回到移动设备,自定义属性返回,但组信息似乎在某处丢失

我在移动设备日志中显示以下内容

“BasicAuthRealm”:{“userId”:“user1”,“attributes”:{“AuthenticationDate”:“Thu Nov 14 22:39:35 EST 2013”},“isUserAuthenticated”:1,“displayName”:“Fred Flintstone”},“WL Authentication Success”:{“userId”:“user1”,“attributes”:{“AuthenticationDate”:“Thu Nov 14 22:39:35 EST 2013”},“isUserAuthenticated”:1,“displayName”:“Fred Flintstone”},

我正在运行WL6.0.0.1企业版,并且运行的是Liberty server v8.5.5.0


有什么想法吗?

在用户成功进行身份验证后,不会将groups对象发送回客户端。返回的UserIdentity对象的唯一部分是名称、显示名称和属性。我不知道这些团体没有被送回的原因。也许对象的用途只针对服务器,而不是客户机

不幸但简单的解决方法是将您需要了解的有关组的任何信息添加到attributes对象中