身份验证中的重定向循环

时间:2015-07-23 22:54:44

标签: c# asp.net asp.net-identity

我使用身份验证用户身份,但在进入主页时我不断获得重定向循环(网址太长)。

HTTP Error 404.15 - Not Found
The request filtering module is configured to deny a request where the query string is too long.

Detailed Error Information:
Module     RequestFilteringModule
Notification       BeginRequest
Handler    ExtensionlessUrl-Integrated-4.0
Error Code     0x00000000

Physical Path      c:\...\auth\login
Logon Method       Not yet determined
Logon User     Not yet determined
Request Tracing Directory      C:\...\IISExpress\TraceLogFiles\BUDGETINGMANAGER

我使用visual studio 2013,并完成了像这里的所有事情 - http://benfoster.io/blog/aspnet-identity-stripped-bare-mvc-part-1

我找到了解决这个问题的方法,但都没有。我试过了:

1)启用匿名身份验证

2)在config.web中禁用Windows身份验证:

<windowsAuthentication enabled="false" />
  <system.web>
    <authorization>
      <windowsAuthentication enabled="false" />
      <anonymousAuthentication enabled="true" />
    </authorization>
  </system.web>

出了什么问题?

1 个答案:

答案 0 :(得分:0)

尝试在应用程序和IIS中增加查询字符串允许的最大长度:

申请:

<httpRuntime maxQueryStringLength="32768" />

IIS:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxQueryString="32768"/>
    </requestFiltering>
  </security>
</system.webServer>

https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxquerystringlength(v=vs.110).aspx

https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits