Fuyu Persimmon
Fuyu Persimmon

Reputation: 483

Windows Authentication not working for MVC 4 app on Windows Server 2008 with IIS 7.0

Getting this error:

HTTP Error 401.1 - Unauthorized You do not have permission to view this directory or page using the credentials that you supplied.

I have successfully got Windows Authentication setup on my Windows 7 with IIS 7.5, just not on the test server (Windows Server 2008). Test server is within the network and I have access.

Things I have tried:

  1. Turned on Windows feature, Windows Authentication

enter image description here

  1. In IIS (7.0) Authentication, set Windows Authentication to enabled & Anonymous Authentication to disabled.

enter image description here

  1. This is from the web.config file:
<system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime />
    <authentication mode="Windows" />
    <authorization>
      <allow users="MyDomain\SomeUser" />
      <deny users="*" />
    </authorization>
    <pages controlRenderingCompatibilityVersion="4.0" />
  </system.web>

I can't think figure this out. Any ideas?

Upvotes: 0

Views: 833

Answers (1)

Fuyu Persimmon
Fuyu Persimmon

Reputation: 483

As I mentioned above, when I publish and browse to that application on my windows 7 computer the application works without a user/pass popup. But if I publish and browse to the application on the test server (Windows Server 2008) I keep getting a user/pass popup.

Here is the strange thing, browsing to the application from the test server doesn't work. However, browsing to the application from my own computer (Windows 7) to the application which is published on the test server works ONLY after entering user/pass in the pop.

I still don't know why I can't browse to the application while on the test server. It is a virtual machine so maybe it recognized me as something unexpected when I am logged in.

Upvotes: 1

Related Questions