【问题标题】:asp.net How To allow only one Domain userasp.net 如何只允许一个域用户
【发布时间】:2012-11-15 10:44:34
【问题描述】:

我在互联网上查找过这个问题,但没有具体说明如何解决我的问题。
它是一个托管在 IIS7 上的非常小的 Web 应用程序。在我的 web.config 我有这个代码:

<system.web>
      <authorization>
        <allow users="WORKGROUP\SOMEONE"/>
        <deny users="?"/>
    </authorization>
    <roleManager enabled="true" />
    <compilation debug="true" targetFramework="4.0" />
</system.web>

当我访问我的网站时,它给了我以下错误

401 - Unauthorized: Access is denied due to invalid credentials.

我只想验证一个域用户,并且我认为我已经正确使用了所有内容。请指导我我在这里缺少什么

【问题讨论】:

  • 不需要在 IIS 中添加&lt;authentication mode="Windows"/&gt; 并开启 Windows Auth 吗?
  • 如何在 IIS 中开启 Windows 身份验证??
  • 在“功能视图”中双击身份验证,转到您想要的站点/应用程序。您应该在那里看到所有支持的类型。您需要禁用匿名并启用 Windows。
  • 亲爱的,我只看到表单身份验证、匿名身份验证和 ASP.NET 模拟都被禁用。我在那里没有看到任何窗口

标签: asp.net authentication iis-7 web-config


【解决方案1】:

您需要安装 Windows 身份验证并在 IIS 网站上启用它。

有关如何在 Windows 7 和 Windows Server 2008R2 上安装和配置 Windows 身份验证的详细信息,请参阅此帖子:http://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication

【讨论】:

    猜你喜欢
    • 2010-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-28
    • 2016-07-25
    • 2021-11-11
    • 2013-07-05
    相关资源
    最近更新 更多