使用安全组在Active Directory中基于角色Asp.Net认证 [英] Asp.Net Role-based authentication using Security groups in Active Directory

查看:142
本文介绍了使用安全组在Active Directory中基于角色Asp.Net认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一些简单的(我认为) - 确保我们的域名使用Active Directory组使用基于角色的安全性我的应用

I am attempting to do something simple (I thought) - securing my application using roles-based security using Active Directory groups in our Domain.

具体来说,我需要证明这取决于是否在当前登录用户在页面上/隐藏的项目是在Active Directory中域\\ A组的一部分。出于某种原因,它是在使用Active Directory这很难发现的信息。一切,我似乎找到了进入使用使用角色基于表单的身份验证的详细信息,或者它使用一个数据库来存储信息。

Specifically, I need to show/hide items on a page depending upon whether the currently logged in user is part of domain\groupA in Active Directory. For some reason, it is difficult finding information on using Active Directory for this. Everything I seem to find goes into details of using forms-based authentication using roles, or it uses a DB to store the information.

所有我想要做的就是用我们已经列出的安全结构,我们的Active Directory中。有人可以解释我需要什么?

All I want to do is use our already outlined security structure in our Active Directory. Can someone please explain what I need?

我需要:


  1. < roleManager启用=真/> 的web.config

  2. <让角色=域\\ A组/> 的web.config

  3. IIS设置为Windows身份验证

  4. 如果(User.IsInRole(@域\\ A组)){//做的东西} 在我的网页?

  1. <roleManager enabled="true"/> in web.config
  2. <allow roles ="domain\groupA"/> in web.config
  3. IIS set to windows authentication
  4. if (User.IsInRole(@"domain\groupA")){ //do stuff } in my page?

还有什么我缺少什么?什么? 导致其无法正常工作。嘿嘿。

What else am I missing? Anything? 'cause its not working. heh.

感谢所有您的帮助。

推荐答案

您可能只需要一个RoleProvider添加到您的web.config告诉应用程序如何做搜索对广告。

You probably just need to add a RoleProvider to your web.config to tell the app how to do searches against AD.

样品code href=\"http://msdn.microsoft.com/en-us/library/system.web.security.windowstokenroleprovider.aspx\">here.

Sample code from here.

<roleManager defaultProvider="WindowsProvider" 
  enabled="true"
  cacheRolesInCookie="false">
  <providers>
    <add
      name="WindowsProvider"
      type="System.Web.Security.WindowsTokenRoleProvider" />
  </providers>
</roleManager>

这篇关于使用安全组在Active Directory中基于角色Asp.Net认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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