【问题标题】:Application hosted on local IIS 10 (Windows 10) failing windows authentication on other system托管在本地 IIS 10 (Windows 10) 上的应用程序未能在其他系统上进行 Windows 身份验证
【发布时间】:2017-08-04 03:14:49
【问题描述】:

我已经在我的本地系统 IIS 10、Windows 10 上托管了我的 MVC 4 应用程序并启用了 Windows 身份验证。它对我来说很好,并且 Windows 身份验证按预期工作。但是,如果我将我的链接分享给组织http://inenanandv4l5c:8082/http://10.30.78.41:8082/ 中的其他人,Windows 身份验证对他们来说不会成功,它会不断要求输入密码和用户名,并在 3 次尝试后最终失败。 我已经搜索了几乎所有关于 SO 的相关解决方案并用谷歌搜索,但建议的设置都没有奏效。 我正在使用 ApplicationPoolIdentity 进行身份设置。

有什么想法吗?

编辑添加网络配置

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  </configSections>
  <connectionStrings>

  </connectionStrings>
  <log4net>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
      </layout>
    </appender>
    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file value="C:\Logging\" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <datePattern value="yyyyMMdd" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %level %thread %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <!--<appender-ref ref="ConsoleAppender" />-->
      <appender-ref ref="RollingFile" />
    </root>
  </log4net>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="APPVERSION" value="V2.0" />
  </appSettings>
  <system.web>
    <authentication mode="Windows" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <identity impersonate="false" />
    <customErrors mode="On" />
  </system.web>
  <system.webServer>
    <modules>
      <!--<remove name="FormsAuthentication" />-->
    </modules>
    <security>
      <requestFiltering>
        <requestLimits maxQueryString="327680" />
      </requestFiltering>
    </security>
    <httpErrors>
      <remove statusCode="403" subStatusCode="-1"/>
      <error statusCode="403" path="AccessDenied/Index" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>

【问题讨论】:

    标签: asp.net-mvc-4 iis windows-10 windows-authentication iis-10


    【解决方案1】:

    1.验证运行应用的“应用程序池”的用户(IIS AppPool\MyApplicationPoolName)是否拥有应用所在位置的必要权限。

    2.验证您的应用程序提供程序是否按以下顺序设置以进行 Windows 身份验证: 1. NTLM 2. 协商

    身份模拟更改为true

    <system.web>
    <authentication mode="Windows" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <identity impersonate="true" />
    <customErrors mode="On" />
    

    【讨论】:

    • 你能解释一下第 1 点吗?什么是 (IIS AppPool\MyApplicationPoolName) ?如果我的应用程序池名称是苹果,我需要检查什么?
    • 你不能提供你的 web.config 的例子
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-19
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    相关资源
    最近更新 更多