0
我有一个扩展AbstractUserStoreManager的类。wso2身份服务器4.10只读自定义UserManagerStore类
我的问题是目前与getRoleListOfUser()方法。此处返回的列表显示在UI中的“未分配的角色”列表中,而不是在“分配的角色”列表中。即该方法似乎表现得像返回所有可能的角色,而不是分配给用户的角色。
是否有需要使用此角色列表设置的内部属性?这是一个已知的错误?
@Override
public String[] getRoleListOfUser(String userName)
throws UserStoreException {
// check whether roles exist in cache
try {
String[] names = getRoleListOfUserFromCache(this.tenantId, userName);
if (names != null) {
return names;
}
} catch (Exception e) {
// if not exist in cache, continue
}
List<String> roles = new ArrayList<String>();
// **code removed ** - but, roles is populated by a web service.
String [] roleList = (String[]) roles.toArray(new String[roles.size()]);
addToUserRolesCache(this.tenantId, userName, roleList);
// TODO: make roleList apply to assigned roles, rather than unassigned roles!
return roleList;
}
我的实现是不同于现有的例子,因为我使用的Web服务调用,而不是直接针对与JDBC用户存储查询。
但是,这看起来类似于这个问题:ldap-user-store-not-working ,除了我使用我自己的类而不是LDAP。
任何建议,将不胜感激。