.netasp.net-mvcasp.net-mvc-4elmahelmah.mvc

ASP.NET MVC Site With ELMAH.MVC - Windows Authentication


I am creating an MVC4 site using .NET 4.0, IIS 7+. It is internal so I am using Windows Authentication. I have decided to use ELMAH, and since this is MVC I have decided to use the Elmah.MVC NuGet package.

Logging exceptions works. I have it setup to log to the App_Data folder and to also send emails. It does both of these things just fine.

But I wanted to use the UI to actually look at all the errors. So I browse to site.com/elmah and the site pops up with a request for my credentials. This is confusing to me since it should be using Windows Authentication and I should be on the list of users already. The rest of my application uses the HttpContext.Current.User correctly from the visiting user so I am confused how /elmah is not working correctly.

The site's Application Pool is set to NetworkService and the site itself is set to connect using Pass-through authentication.

What would I be missing exactly?

Here are my elmah.mvc appSettings:

<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="*" />
<add key="elmah.mvc.allowedUsers" value="DOMAIN\user1,DOMAIN\user2" />
<add key="elmah.mvc.route" value="elmah" />

Solution

  • Any one still looking, in the latest elmah nuget package there is a new setting for username case sensitivity.

    <add key="elmah.mvc.UserAuthCaseSensitive" value="false" />