【发布时间】:2012-07-03 09:24:56
【问题描述】:
我要做的:
单击开始,指向管理工具,然后单击 Internet 信息服务 (IIS) 管理器。在连接窗格中,展开 服务器名称,展开站点,然后选择站点、应用程序 或您要为其启用扩展保护的 Web 服务 Windows 身份验证。滚动到主页中的安全部分 窗格,然后双击身份验证。在认证中 窗格中,选择 Windows 身份验证。单击操作中的启用 窗格。单击“操作”窗格中的“高级设置”。
在 web.config 中设置后<authentication mode="Windows" />
如果我从 VS2010 启动应用程序 - 一切正常。 如果否则我从 IIS 启动应用程序我有问题。 请求的用户数据我输入 Computer\NameUser。 然后是一个错误:
错误 HTTP 401.2 - 未经授权 您无权查看此页面 因为身份验证标头的不可接受性。
更新:
更新2: 文件:C:\Windows\System32\inetsrv\config\applicationhost.config
<location path="windowsAuthTest">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" userName="User" password="[enc:AesProvider:BZ7e2mkTjJL7Wo8xMm2PQKZ2biP1nKB2SjAfw9WmJoBhkMbl4DYqEJU0bzIj3CxF:enc]" />
<windowsAuthentication enabled="true" useKernelMode="false">
<extendedProtection tokenChecking="None" />
<providers>
<clear />
<add value="NTLM" />
<add value="Negotiate" />
</providers>
</windowsAuthentication>
</authentication>
</security>
</system.webServer>
</location>
【问题讨论】:
标签: c# asp.net-mvc-3 iis iis-7 windows-authentication