Is it possible to get the Windows username from a client that is sending a request to the server hosting the site, without the user having to enter it into a login field?
I am building a website that is public facing and my managers want anyone on our network where the site is hosted to not have to login when accessing the site. They want the site to just automatically get the Windows username and authenticate it against Active Directory when they access the site.
I have been playing around with stuff like Request.LogonUserIdentity.Name and WindowsPrincipal(WindowsIdentity.Name), but they always return the IIS app pool name. I have tried every combination of authentication in IIS.
The HttpContext.User.Identity.Name is always blank when I start the site and check it in the home controller, but it is populated after I try to access an area of the site and use the authentication that brings up a login box where the user has to enter their Windows credentials.
Is there no way to just automatically get the Windows username without having to prompt the user for it?
************************************************ SOLVED ****************************************************
I had all the setting set correctly. The only thing I was doing wrong was using Firefox. Internet Explorer is the only browser that will automatically retrieve the user's windows account and populate the User.Identity object. Any other browser can populate this, but only after prompting the user for their Windows account credentials.