Debug Help: Web Application Redirects to Index (possibly Owin) for first login attempts after IIS Recycle

So, I'm a little stuck. I have an MVC 5 app that uses Owin (doesn't use out of the box) for authentication.

The app works fine, except when I recycle the IIS7.5 app pool, then it kicks in. When I recycle the pool (I wait about 2 minutes after) and try to login, it will redirect me without error to the page index

at least 2+ times twice. Then eventually it will allow me to login successfully. Please note that anonymous authentication is used for the application in this application pool.

Now I find this rather strange, in all areas where it can lead to an error, I have an attempt to catch and deal with it (none of these catches are redirected to index

without an error message). Also, I implemented Elmah to check if any errors are slipping and which are not.

There are two reasons why this worries me:

  • Does this only happen after the application pool is disposed of? I'm not sure ... Are users listening by accident?
  • I have no idea what the source of this behavior is and not sure how to debug it, is there any suggestions on how to do this?

My only guess is that something is messed up with cache or headers and 401 is returned, resulting in owin redirecting with LoginPath

:

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = "ApplicationCookie",
            LoginPath = new PathString("/PunchAuthOp/Index")
        });
    }
}

      

Again, I'm not sure why he would do this.

I looked at my HTTP traffic to HTTPFox and it looks like when this redirect happens I get an error 0 GET Aborted NS_BINDING_ABORTED

. However, when comparing a successful request to a failed one, I see no difference.

I guess my question is, does anyone have any ideas on how to debug this?
Note. This doesn't happen when running through VS, only when deploying.

+3


source to share





All Articles