3

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?

user373455
  • 12,675
  • 4
  • 32
  • 46
  • 2
    And what's happening? Are you not getting the dialog? Are you getting it but can't sign in? We need symptoms. – Grant Thomas Oct 30 '12 at 14:14
  • Thing is the only thing happening is that I get redirected to "login.aspx", no dialogue! Not much to go on but, that's all the feedback I get. – user373455 Oct 30 '12 at 14:18
  • 1
    And you have an authorization rule that _allows_ users to browse to `login.aspx` (or at least not covered by your restrictive rules)? Meaning the page is servable to strangers? Then you never will get the dialog. Try removing the default login page declaration. – Grant Thomas Oct 30 '12 at 14:24
  • Obvious question: are you hitting the web server from a computer joined to the domain, using a browser that supports Windows (NTLM) authentication? – Adam Maras Oct 30 '12 at 14:28
  • @GrantThomas Abit unclear what you mean. I don't have this declaration anywhere in the web.config, or any other LoginUrl declared. Since I don't have a login.aspx file I get a "The resource cannot be found" (obviously). – user373455 Oct 30 '12 at 14:46

1 Answers1

7

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.

Community
  • 1
  • 1
user373455
  • 12,675
  • 4
  • 32
  • 46