首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Waffle检索用户的组/角色?

如何使用Waffle检索用户的组/角色?
EN

Stack Overflow用户
提问于 2019-07-19 12:42:41
回答 1查看 234关注 0票数 0

我已设置Active Directory,并且想要设置SSO。我正在使用Waffles,我想知道我的Servlet中的用户组。如何检索用户所在的组?

EN

回答 1

Stack Overflow用户

发布于 2019-08-26 13:40:11

我使用WindowsPrincipal来获取用户的组。

代码语言:javascript
复制
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
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57105645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档