我已设置Active Directory,并且想要设置SSO。我正在使用Waffles,我想知道我的Servlet中的用户组。如何检索用户所在的组?
发布于 2019-08-26 13:40:11
我使用WindowsPrincipal来获取用户的组。
WindowsPrincipal p = (WindowsPrincipal)request.getSession().getAttribute("waffle.servlet.NegotiateSecurityFilter.PRINCIPAL");
for(Map.Entry<String, WindowsAccount> entry: p.getGroups().entrySet()){
System.out.println(entry.getValue().getName); //The is the group that the user memberOf
}https://stackoverflow.com/questions/57105645
复制相似问题