查询活动目录以获取用户在 .NET 中的角色 [英] Query active directory to get a user's roles in .NET

查看:27
本文介绍了查询活动目录以获取用户在 .NET 中的角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 Linq to Active Directory 但我发现很难获得用户所属的所有角色.我可以检索他们直接组的列表,但它不是递归的.

I have been using Linq to Active Directory a bit but I am finding it difficult to get a list of all roles of which the user is a member. I can retrieve a list of their immediate groups but it isn't recursive.

我试图查询 AD 目录的原因是为了解决内置的角色管理器 AspNetWindowsTokenRoleProvider,除非用户名与当前的 Windows 身份匹配,否则它不会让你调用 Roles.GetRolesForUser(username).

The reason I am trying to query AD directory is to work around the built-in Role Manager AspNetWindowsTokenRoleProvider which won't let you call Roles.GetRolesForUser(username) unless the username matches the current Windows Identity.

推荐答案

你看过这个?

这篇关于查询活动目录以获取用户在 .NET 中的角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆