【问题标题】:How to retrieve user's group/role using Waffle?如何使用 Waffle 检索用户的组/角色?
【发布时间】:2019-07-19 04:42:41
【问题描述】:

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

【问题讨论】:

    标签: java tomcat waffle


    【解决方案1】:

    我使用 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
    }
    

    【讨论】:

      猜你喜欢
      • 2023-01-08
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-15
      • 2016-04-21
      相关资源
      最近更新 更多