tags:

views:

429

answers:

6

I have the following settings:

Web.config

Authentication Mode = "Windows"

Virtual Directory -> Enable anonymous access - UNCHECKED -> Integrated Windows authentication - CHECKED

When a user goes to the default page on the intranet, he gets prompted to enter the user name and password even though he has already been authenticated

**UPDATE: To clarify what I am doing - We have an application that is set to windows authentication = forms - There was a request that for certain servers in the intranet, we would want to bypass the login.aspx page - All that the login.aspx page does is, grabs the windows username, checks the database, gets the forms username and password and lets the user log in - I am using User.Identity.Name to get the windows user name to do a mapping

**

+1  A: 

Check the file system permissions. Even if they are authenticated they can be prompted if they don't have access to the files.

Jon Tackabury
Each user must have NTFS permissions to the file. Create a new AD group and add everyone who must access the site, then apply Read to all files in the site to that group.
Dave Swersky
Thanks Dave - that's a good way to ensure that the right people have access.
Jon Tackabury
+3  A: 

Did you turn on impersonation?

<identity impersonate="true" />
Jon
You still need thie right file permissions of course by the way. But if you do not turn on impoersonation the browser will use its default user instead of the logged in user for authentication.
Jon
A: 

Another consideration is Kerberos authentication only survives 2 hops. In this case you can use Kerberos/NTLM authentication if your AD is setup to handle the authentication correctly you should be able to pass the token along farther.

Quintin Robinson
+1  A: 

Also make sure that when you are viewing the site in Internet Explorer that the zone in the status bar says "Intranet Zone". Otherwise it won't log you in by default.

David
A: 

Correct me if I'm wrong, but wouldn't the aspx page get the IIS user?

toast
A: 

You must use Internet Explorer as the client if you want to avoid any login at all.
Also, as David mentioned, the site must be in the 'Intranet' Zone for IE to automatically send your windows credentials. A site will be in the 'Intranet' zone if it uses a one-word servername. Otherwise, you must add it to the list of sites. See Internet settings in windows.

Firefox will prompt you for credentials (But they can be autocompleted).

Matt Brunell