Web 应用程序使用窗口域帐户进行身份验证 [英] Web application to use window domain accounts for authentication

查看:37
本文介绍了Web 应用程序使用窗口域帐户进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您有一个将在网络内运行的 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

  1. 启动 Internet 信息服务(IIS).
  2. 右键单击您的应用程序的虚拟目录,以及然后单击属性.
  3. 点击目录安全选项卡.
  4. 下匿名访问和身份验证控件,单击编辑.
  5. 确保匿名访问复选框不是选择集成Windows身份验证是唯一的选择复选框.

然后您可以再次使用 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 应用程序使用窗口域帐户进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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