HTTP Error 404.15 - Not Found ...because the query string is too long
The only time I've personally run into this issue is when I accidentally added [Authorize]
to a child action that was used in the layout. Adding [Authorize]
to your sign in action would have the same effect or simply neglecting to add [AllowAnonymous]
on your sign in action, when the controller it is in has [Authorize]
on it. Long and short, this is being caused by something requiring authorization on the actual sign in page, which then causes you to be redirected to the sign in page, which needs authorization, causing you to be redirected to the sign in page, etc.
tl;dr
- Make sure your sign in / login action does not have
[Authorize]
. - Make sure your sign in / login action does have
[AllowAnonymous]
. - Make sure no child actions used in your layout or sign in page have
[Authorize]
or have[AllowAnonymous]
if they are in a controller decorated with[Authorize]
.
I got this error when I enabled Windows authentication. I wanted to authorize the user based on Windows login and I do not want login page in my application.
I got the error fixed by adding the below in my Web config file.
Under the tag
system.web
, changed authenticationmode="None"
to authenticationmode="Windows"
Under tag
appSettings
, added addkey="owin:AutomaticAppStartup" value="false"