Windows身份验证在IISExpress中有效,但在IIS中无效

kyl*_*leb 2 asp.net iis asp.net-mvc active-directory windows-authentication

我有一个奇怪的问题.我在Visual Studio 2013中使用最新的MVC5.我正在尝试创建一个托管匿名API的站点以及一个需要通过Windows身份验证的Intranet域凭据的管理仪表板.一切都像我期望的那样在运行IIS Express时工作,但在真正的IIS中托管时却没有.

当在真正的IIS中托管时,它给我一个登录框,就像我期望的管理部分,但它不需要我的登录并一直提示我.我知道这是正确的用户名和密码.知道为什么会这样吗?

我在Windows功能中安装了Windows身份验证,并在IIS中为该站点启用了所有这些功能.

以下是我的设置..

[Authorize]
public class DashboardController : Controller

<add key="EnableSimpleMembership" value="false" />

<authentication mode="Windows"/>
<authorization>
   <allow users="?" />
</authorization>
</system.web>
  <location path="gsapi">
    <system.webServer>
      <security>
        <authentication>
          <anonymousAuthentication enabled="true"/>
          <windowsAuthentication enabled="true"/>
        </authentication>
      </security>
    </system.webServer>
  </location>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

小智 6

有一个安全功能试图拦截您服务器上的反射攻击.这些攻击基本上是"中间人"攻击,攻击者对尝试进行身份验证的两个参与系统执行质询 - 响应协议.

当您的服务器使用映射到环回地址的主机名时,试图保护您免受这些攻击的安全功能无法告知欺诈性的合法请求.症状是所有质询响应尝试都将失败.

您可以选择在注册表中指定主机名,或禁用环回检查(不推荐).

在注释中链接的知识库文章提供了有关解决此问题的更改的具体说明:http: //support.microsoft.com/kb/896861