Web应用程序使用窗口域帐户进行身份验证

发布于 2024-07-10 08:31:34 字数 334 浏览 7 评论 0原文

如果您有一个将在网络内运行的 Web 应用程序,那么它支持 Windows 身份验证(活动目录?)是有意义的。

使用 AD 安全模型是否有意义,或者我是否可以创建自己的角色/安全模块,某些管理员必须为每个用户进行配置?

我以前从未处理过 Windows 安全性,因此我对于应该如何处理在 Windows 网络中运行的 Web 应用程序的安全性感到非常困惑。

我想我必须解决两个主要问题:

1. authentication
2. authorization

我有一种感觉,最佳实践会说自己处理授权,但使用 AD 身份验证对吗?

If you have a web application that will run inside a network, it makes sense for it to support windows authentication (active directory?).

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?

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

I have a feeling that best-practice would say to handle authorization myself, but use AD authentication right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

颜漓半夏 2024-07-17 08:31:34

基本上,Windows 会处理所有事情,您从不存储用户名或密码,AD 和 IIS 会为您完成所有工作,

将其添加到您的 web.config

 <system.web>
  ...
  <authentication mode="Windows"/>
  ...
 </system.web>

配置 Windows 身份验证

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

然后您可以再次使用web.config处理业务或授权。 例如,

<authorization>
 <deny users="DomainName\UserName" />
 <allow roles="DomainName\WindowsGroup" />
</authorization>

在此处阅读更多信息: http://msdn.microsoft.com/en-us /library/ms998358.aspx

Basically windows handles everything, you never store usernames or passwords, AD and IIS do all the work for you

add this to your web.config

 <system.web>
  ...
  <authentication mode="Windows"/>
  ...
 </system.web>

To configure Windows authentication

  1. Start Internet Information Services
    (IIS).
  2. Right-click your
    application's virtual directory, and
    then click Properties.
  3. Click the
    Directory Security tab.
  4. Under
    Anonymous access and authentication
    control, click Edit.
  5. Make sure the
    Anonymous access check box is not
    selected
    and that Integrated Windows
    authentication is the only selected
    check box
    .

You can then deal with the business or authorization using web.config again. for example

<authorization>
 <deny users="DomainName\UserName" />
 <allow roles="DomainName\WindowsGroup" />
</authorization>

Read more here: http://msdn.microsoft.com/en-us/library/ms998358.aspx

凡尘雨 2024-07-17 08:31:34

我在一些内部站点上使用了 Windows 安全性。

基本上我的设置方法是删除 IIS 中的匿名访问,然后通过标准 Windows 安全模型分配站点文件的权限。

我不确定这是否是最佳实践,但它对我来说一直很有效。

I used windows security on some of my internal sites.

Basically the way I set it up is I remove anonymous access in IIS, then assign permissions on the sites files though the standard windows security model.

I'm not sure if this is the best practices, but it has always worked well for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文