如果您有一个将在网络内运行的 Web 应用程序,那么它支持 Windows 身份验证(活动目录?)是有意义的.
If you have a web application that will run inside a network, it makes sense for it to support windows authentication (active directory?).
使用 AD 安全模型是否有意义,或者我是否会创建自己的角色/安全模块,某些管理员必须为每个用户配置?
Would it make sense to use AD security model as well, or would I make my own roles/security module that some admin would have to configure for each user?
我以前从未处理过 Windows 安全性,所以我很困惑我应该如何处理在 Windows 网络中运行的 Web 应用程序的安全性.
I've never dealt with windows security before, so I am very confused as to how I should be handling security for a web application that runs within a windows network.
我想我必须解决两个主要问题:
I guess there are 2 major points I have to tackle:
1. authentication
2. authorization
我有一种感觉,最佳实践会说自己处理授权,但使用 AD 身份验证对吗?
I have a feeling that best-practice would say to handle authorization myself, but use AD authentication right?
基本上 windows 处理一切,你从不存储用户名或密码,AD 和 IIS 为你做所有的工作
Basically windows handles everything, you never store usernames or passwords, AD and IIS do all the work for you
将此添加到您的 web.config
<system.web>
...
<authentication mode="Windows"/>
...
</system.web>
配置 Windows 身份验证
To configure Windows authentication
然后您可以再次使用 web.config
处理业务或授权.例如
You can then deal with the business or authorization using web.config
again. for example
<authorization>
<deny users="DomainNameUserName" />
<allow roles="DomainNameWindowsGroup" />
</authorization>
在此处阅读更多信息:http://msdn.microsoft.com/en-我们/图书馆/ms998358.aspx
这篇关于Web 应用程序使用窗口域帐户进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!