【问题标题】:How to get list of groups the user is associated with in Azman?如何在 Azman 中获取用户关联的组列表?
【发布时间】:2010-02-24 12:44:29
【问题描述】:

我能够获得与经过身份验证的用户相关联的角色,但不能获得与组相关联的角色。有没有办法获取群组

WindowsIdentity userIdentity = HttpContext.Current.User.Identity as WindowsIdentity;

AzAuthorizationStoreClass azManStore = new AzAuthorizationStoreClass();

string storeConnectionString = ConfigurationManager.ConnectionStrings["<CONN STRING>"].ConnectionString;

azManStore.Initialize(0, storeConnectionString, null);

IAzApplication azApp = azManStore.OpenApplication("<APP NAME>", null);

ulong token = (ulong)userIdentity.Token;

IAzClientContext ctx = azApp.InitializeClientContextFromToken(token, null);

object roles = ctx.GetRoles(String.Empty);

【问题讨论】:

    标签: active-directory active-directory-group azman


    【解决方案1】:

    我还没有找到方法。在我的项目中,我们对此有一个要求,最终做了一个简单的实现,遍历每个组并检查用户是否是成员。这种方法的问题在于,它忽略了通过组中的组的成员资格以及通过作为 AD 组成员的用户的成员资格,该 AD 组的成员是 AzMan 组的成员。您可以扩展解决方案以涵盖这些场景,但最终我认为,当您开始提出此类问题时,您可能正在使用 Azman(基于操作(或任务)的安全性)沿着基于角色的安全路径前进。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-20
      相关资源
      最近更新 更多