Dresel / EasyErrorHandlingMvc

SimpleErrorMVC is an MVC package that simplifies error handling of MVC web applications.
7 stars 1 forks source link

Windows authentication issue? #2

Open arracos opened 9 years ago

arracos commented 9 years ago

Hey. Thanks for putting in the work on this package.

I'm trying to stand up an MVC 4 app using Windows authentication. I've followed the ToDo instructions from the ErrorHandlingConfg.cs. If the "Unauthorized" custom error is left enabled in the web.config then authentication does not occur and I'm unable to access the app. By removing that one custom httpError from the web.config I'm able to authenticate and log into the app.

Any thoughts or suggestions?

image

image

image

Dresel commented 9 years ago

What do you mean with "Authentication does not occur"? I'm afraid I do not know much about Windows Authentication, I only know that this is handled by IIS itself.

From http://forums.iis.net/t/1170491.aspx?Configuring+custom+401+error+message+results+in+perpetual+401+error+page:

401.2 is something the browsers relying on to show you prompts.

You could try using sub status codes different from 401.2 for example:

<error statusCode="401" subStatusCode="1" responseMode="ExecuteURL" path="/Unauthorized" />

Does this help you?