IIS - 启用基本身份验证会导致登录重定向循环

时间:2014-08-14 11:17:04

标签: asp.net iis-7

在IIS站点上启用基本身份验证后,我尝试访问该站点。它没有显示登录表单,但是将我重定向到其他具有长链接的地方,我无法弄明白。

http://我的域名/登录/登录/登录?ReturnUrl =%2FLogin%2FLogin%2FLogin%3FReturnUrl%3D%252FLogin%252FLogin%252FLogin%253FReturnUrl%253D%25252FLogin%25252FLogin%25252FLogin%25253FReturnUrl%25253D%2525252FLogin %2525252FLogin%2525252FLogin%2525253FReturnUrl%2525253D%252525252FLogin%252525252FLogin%252525252FLogin%252525253FReturnUrl%252525253D%25252525252FLogin%25252525252FLogin%25252525252FLogin%25252525253FReturnUrl%25252525253D%2525252525252FLogin%2525252525252FLogin%2525252525252FLogin%2525252525253FReturnUrl%2525252525253D%252525252525252FLogin%252525252525252FLogin%252525252525252FLogin%252525252525253FReturnUrl%252525252525253D%25252525252525252FLogin %25252525252525252FLogin%25252525252525252FLogin%25252525252525253FReturnUrl%25252525252525253D%2525252525252525252FLogin%2525252525252525252FLogin%2525252525252525252FLogin%2525252525252525253FReturnUrl%2525252525252525253D%252525252525252525252FLogin%252525252525252525252FLogin%252525252525252525252FLogin%252525252525252525253FRetu rnUrl%252525252525252525253D%25252525252525252525252FLogin%25252525252525252525252FLogin%25252525252525252525252FLogin%25252525252525252525253FReturnUrl%25252525252525252525253D%2525252525252525252525252FLogin%2525252525252525252525252FLogin%2525252525252525252525252FLogin%2525252525252525252525253FReturnUrl%2525252525252525252525253D%252525252525252525252525252FLogin%252525252525252525252525252FLogin%252525252525252525252525252FLogin%252525252525252525252525253FReturnUrl%252525252525252525252525253D%25252525252525252525252525252FLogin%25252525252525252525252525252FLogin%25252525252525252525252525252FLogin%25252525252525252525252525253FReturnUrl%25252525252525252525252525253D%2525252525252525252525252525252FLogin%2525252525252525252525252525252FLogin%2525252525252525252525252525252FLogin% 2525252525252525252525252525253FReturnUrl%2525252525252525252525252525253D%252525252525252525252525252525252FLogin%252525252525252525252525252525252FLogin%252525252525252525252525252525252FLogin%252525 252525252525252525252525253FReturnUrl%252525252525252525252525252525253D%25252525252525252525252525252525252Fadmin

<?xml version="1.0" encoding="utf-8"?>
<!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=301880
    -->
<configuration>
    <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>

    <appSettings>
        <!-- Required by Microsoft ReportViewer control -->
        <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="recaptchaPublicKey" value="6LeN_vUSAAAAAM5eeRSrzyi4ThIoe6dX5fskng9T" />
        <add key="recaptchaPrivateKey" value="6LeN_vUSAAAAAMGpwlapQ-ZNmswHmrI8ImjSUiPL" />

    <add key="MvcReportViewer.AspxViewer" value="/MvcReportViewer.aspx" />
    <add key="MvcReportViewer.ReportServerUrl" value="http://localhost/ReportServer" />
    <add key="MvcReportViewer.Username" value="" />
    <add key="MvcReportViewer.Password" value="" />
    <add key="MvcReportViewer.IsAzureSSRS" value="false" />
      <add key="MvcReportViewer.AspxViewer" value="/MvcReportViewer.aspx" />
    <add key="MvcReportViewer.ReportServerUrl" value="http://localhost/ReportServer" />
    <add key="MvcReportViewer.Username" value="" />
    <add key="MvcReportViewer.Password" value="" />
  </appSettings>
    <system.web>
        <globalization culture="nb-NO" />
        <pages>
            <namespaces>
            </namespaces>
        </pages>
        <authentication mode="Windows" />
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
        <hostingEnvironment shadowCopyBinAssemblies="false" />
      <httpHandlers>
       <!--Required by Microsoft ReportViewer control--> 
      <!--<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />-->
    </httpHandlers>
        <identity impersonate="false" />
  </system.web>
    <system.webServer>
        <modules>
            <remove name="FormsAuthenticationModule" />
        </modules>
    <httpErrors existingResponse="PassThrough"></httpErrors>
    <handlers>
       <!--required by microsoft reportviewer control-->
    <remove name="ReportViewerWebControlHandler" />
    <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>
  </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <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="0.0.0.0-5.1.0.0" newVersion="5.1.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="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.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>
        </assemblyBinding>
    </runtime>
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
            <parameters>
                <parameter value="v11.0" />
            </parameters>
        </defaultConnectionFactory>
        <providers>
            <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
    </entityFramework>
</configuration>

1 个答案:

答案 0 :(得分:1)

您的登录页面未配置为允许匿名访问。因此,未经身份验证的用户无法访问登录页面,您将获得此重定向递归。