views:

767

answers:

3

I am developing a simple ASP.NET website that will run on the intranet on a WS2008(IIS7) box and respond to users running XP/IE8. Everything is domain connected and I am trying to automatically login the users much like SharePoint does.

On my dev machine (XP), when running the site through VS, everything works. I can pickup on the user perfectly. I am using the following settings:

<authentication mode="Windows"/>
<identity impersonate="true"/>
<anonymousIdentification enabled="false"/>

<authorization>
    <allow users="*"/>
    <deny users="?"/>
</authorization>

However, when I publish to the WS2008 box, it doesn't work. Clearly I am missing a setting in IIS7 to support this.

I have the following set for Authentication on the site:

Anon Auth - Enabled
ASP.NET Impersonation - Enabled
Basic Auth - Disabled
Forms Auth - Disabled
Windows Auth - Disabled

What am I missing? Thanks

+5  A: 

Try disabling anonymous login from the iis. Go to the security options for the site on IIS and uncheck the Enable Anonymous login. Make sure that windows authentication is checked.

Edit:: If the login box appears when trying to login with IE, there is a setting that you can set so that IE sends the username when used in the intranet sites. Go to tools > internet options > security and in the security settings select the option Automatic Logon with current username and password or Automatic Logon only in intranet Zone You have to make sure that the site you are trying to use is added in the intranet zone.

There is a similar setting with firefox and chrome I believe but I am not sure how to set it up

TP
in firefox you can do it as shown here: http://sivel.net/2007/05/firefox-ntlm-sso/ (you can just enter the domain or even a root domain: .my-domain.com)
Stefan Egli
That must be it. If I go through the IP or the custom URL, IE must be thinking that it isn't within the intranet. When I go via the machine name, it probably picks up that the machine exists in the domain.
Krisc
My understanding of this is that if you have Anonymous and Windows Authentication both enabled, Anonymous 'wins' (takes precedence) every time (probably because it involves the least processing on the server). I assume this is true of Anonymous and any other combination of authentication methods as well, but I haven't worked with any other authentication method so I can't confirm.
PhilPursglove
A: 

You need to enable "Windows Authentication" in IIS and disable "Anon Auth"

Here are the settings, you should be using:

Anon Auth - Disabled

ASP.NET Impersonation - Enabled

Basic Auth - Disabled

Forms Auth - Disabled

Windows Auth - Enabled

BT
Enabling Windows Authentication causes the login box to popup. Is there another setting to make it use the currently logged in user?
Krisc
Ok - it seems that it works if I hit the server via its machine name. If I go through a hostmask that I setup in my local hosts file, it doesn't work. Perhaps this is more a question of setting up AD?To make this more confusing - Chrome w/ URL works; Chrome w/ machine name does not work; IE w/ URL doesn't work; IE w/ machine name works.
Krisc
A: 

Consider also the intranet zone settings for the browser, as well as the security settings. Try adding other flavors/variations of the URL to the intranet sites zone in IE. My understanding is this is how IE determines if it should automatically submit credentials instead of prompting.

AaronLS