Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

I'm running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /Account/Login when I have no trace of that in my application and my web.config is configured to windows auth.

Any ideas?

Here is my entire web.config file: http://pastie.org/1568510

like image 669
Kevin Jensen Avatar asked Feb 15 '11 21:02

Kevin Jensen


People also ask

Does IIS Express support Windows Authentication?

Unlike IIS Server, IIS Express doesn't support Windows Authentication by default. You can enable the Windows Authentication in IIS Express by modifying the applicationhost. config under the “C:\Users[username]\Documents\IISExpress\config” directory.


2 Answers

Check whether you have WebMatrix.Data.dll and/or WebMatrix.WebData.dll deployed in the bin directory of your application. If they are there (and you know you don't use them) then try removing them and accessing a page that requires authentication.

like image 86
Liam Avatar answered Sep 20 '22 15:09

Liam


In RTM try to add to <appSettings> in Web.config:

<add key="enableSimpleMembership" value="false" /> 

(Thx to Problem exclusively using Windows Authentication in ASP.NET MVC 3 Beta.)

like image 22
TN. Avatar answered Sep 22 '22 15:09

TN.