简体   繁体   English

使用Windows身份验证的ASP.NET角色

[英]ASP.NET Roles with Windows Auth

Super simple question from an ASP newb: I've got an internal-only ASP.NET website I'm working on that uses Windows integrated auth across the board. 来自ASP newb的超级简单问题:我有一个仅在内部使用的ASP.NET网站,我正在使用Windows集成的身份验证。 There are essentially three roles I want to associate with the site: user, manager, and admin. 我想与网站关联的角色主要有三个:用户,经理和管理员。 The site is open to the entire org, so anyone who is authenticated is a user, unless they are a manager or an admin. 该网站对整个组织开放,因此任何经过身份验证的用户都是用户,除非他们是经理或管理员。

The list of admins and managers needs to be in a database, not in the web.config. 管理员和经理列表需要在数据库中,而不是在web.config中。 The role information for this site is not in any way associated with what can be learned from a user's AD profile. 此站点的角色信息与从用户的AD配置文件中学习的内容无关。

I've been picking up ASP.NET pretty quickly and I'm definitely capable of researching the correct solution, but I was hoping someone could start me down the right road here. 我一直在快速学习ASP.NET,我绝对有能力研究正确的解决方案,但我希望有人可以在这里开始我的正确道路。 What's the best way to get this done? 完成这项工作的最佳方法是什么? I imagine it involves using a role provider on top of the integrated auth, but before I started researching a million options and possibly picked the wrong one, I thought I'd ask here. 我想它涉及在集成的身份验证之上使用角色提供程序,但在我开始研究一百万个选项并且可能选错了之前,我想我会问这里。

Thanks! 谢谢!

I had to do this also and I used the below blog entry from Scott Guthrie to get me going.... 我也必须这样做,我使用Scott Guthrie的以下博客条目让我去....

http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx

Worked great for me. 对我来说很棒。

I didn't create a new provider or anything. 我没有创建新的提供商或任何东西。 Scott's blog post lays it out nicely. 斯科特的博客文章很好地阐述了它。 Although it is quite a hack but got me going quickly and did the trick. 虽然这是一个非常黑客,但让我快速前进,并做了伎俩。

With this trick you can use windows auth with DB based roles. 通过这个技巧,您可以使用基于数据库的角色的Windows身份验证。

您可以在此处使用ActiveDirectory 信息使用MembershipProvider

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM