Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication mode Windows not working

When I try to access my page I only get redirected to login.aspx, which is not what's intended.

What I'm after is instead a windows login popup where I authenticate if my current logged in user is not allowed, and if it is, it goes straight to the application.

I'm running a MVC4 project on an IIS6 webserver (yeah, I know.).

I've disabled "Enable anonymous access" in Directory Security - Authentication and access control and checked in "Integrated Windows authentication".

My web.config looks as follows:

<authorization>
  <allow roles="DOMAIN\Role1"/>
  <deny users="*"/>
  <deny users="?"/>
</authorization>
<compilation targetFramework="4.0" debug="true"/>
<authentication mode="Windows">
</authentication>

Any clues?

like image 428
user373455 Avatar asked Nov 22 '25 01:11

user373455


1 Answers

I finally figured this out, by finding this stackoverflow question:
ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

By removing the references WebMatrix.Data.dll and/or WebMatrix.WebData.dll it worked as intended.

like image 125
user373455 Avatar answered Nov 23 '25 16:11

user373455



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!