1

I have an aplication, written in ASP.NET MVC4, It is hosted on IIS with windows authentication (NTLM).

We have one action, that can take a long time to complete (up to 2 hours), we are calling this from our SPA website as an ajax request.

As it is executing - users get prompted to write in their credentials again. Through my testing, it happens around 10 minutes into the request. If they click cancel - the request form the client side is terminated with status code 401.2.

What could be causing this? Users can stay on the page (on and off, in the background), and never get prompted this login.. But the long requests prompt them..

Question #2 - Could it be, that my action (it is not written async....) is blocking the application to complete the authentication handshake? I can't reproduce it locally on My local IIS, only on the server.

User computers, connecting to the site, are not in that windows auth domain.

Screenshot of FRT up until 401

Here are the IIS Logs IIS Logs Note: the request should take 27 minutes. Row 2 is the initial request, rows 3, 5, 7 and 9 are when I received the popup, and entered the credentials. Interesting - that for each of those time, and the first time, there is a 200 response after 27 minutes (Row 2 - Row 4, Row 3 - Row 6, Row 5 - Row 10, Row 7 - Row 11). After Row 9 I shut down my computer, so I guess the response was not made any more.

4
  • 1
    I suggest you use FRT to troubleshoot this issue: learn.microsoft.com/en-us/iis/troubleshoot/…
    – Ding Peng
    Mar 22, 2021 at 1:31
  • I added a screenshot of failed request tracing up until the 401.But I am not sure, it will even help. This gets written once the request finishes. The login prompts 10 minutes into the request. If I log in - it continues for some time, then prompts me again after 10 minutes. Only once I click cancel, it terminates the request and creates the log. But maybe you can help me parse it and understand the problem..
    – Wish
    Mar 22, 2021 at 11:44
  • I saw a 401 error in FRT. This seems to be a permissions issue. You can try to elevate the permissions of this application pool.
    – Ding Peng
    Mar 24, 2021 at 5:18
  • The login popup apears every 11 minutes. If I log in, the requst continues, only once I click cancel, it returns that 401 (I could enter my credentials for an hour, every 11 minutes - it still wont return a response to the client). Could you specify, what permissions?
    – Wish
    Mar 24, 2021 at 6:54

1 Answer 1

0

It seems like session expiration.

1st: check your web.config for:

<system.web>
    <authentication mode="Windows" />
    <sessionState timeout="300" />
</system.web>

2nd: check your App Pool timeout on IIS: IIS App Poll timeout

1
  • sessionState timeout was not present in the web config. In the IIS sessionState panel, it was set to 20 minutes. App Pool timeout was set to 0 (which I think is indefinate). I will experiment with sessionState timeout. Also - the login prompt may show while the requests is still executing - not when it returns a response.
    – Wish
    Mar 19, 2021 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.