HI
My scenario is that i am using Active Directory user to login on my web application so i didnt want to re authenticate user when he access my web application(it ll automatically be authenticated). SO i need active windows client username in my web application. I try HttpContext but it give null value on Client side. On Deployment senario HttpContext return null value.
THX
Loading

Roei BarRank #1,271 · 1.4K reputationPosted Sep 11, 2009, 4:34 AM EDT
and set the IIS Folder Security to Windows authentication
but if you need it use "Enviorment.UserName"
Master BillaRank #2,229 · 630 reputationPosted Sep 11, 2009, 9:05 AM EDT
You can u get like this way
private bool Authenticate(string userName, string password, string domain) { bool authentic = false; try { DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain, userName, password); object nativeObject = entry.NativeObject; authentic = true; } catch (DirectoryServicesCOMException) { } return authentic; }more details here
http://www.codeproject.com/KB/system/everythingInAD.aspx
thank you
kaunainbaig kaunainbaig113 reputationPosted Sep 11, 2009, 3:58 PM EDT
I will try your setting in my office as the active directory is there.
The thing is that will it result in some popup box for authentication first with the iis?. Then it will display the username. (because it is doing just as i have said) and that i don't want to display any popup box. When I type the address of my application in the browser as I am already login in the domain it should just bring the username there,not first i reauthenticate in that popup box and then it brings in the username. I hope it is clear more now.
Roei BarRank #1,271 · 1.4K reputationPosted Sep 12, 2009, 4:05 AM EDT
kaunainbaig kaunainbaig113 reputationPosted Sep 12, 2009, 7:35 AM EDT
kaunainbaig kaunainbaig113 reputationPosted Sep 14, 2009, 7:40 AM EDT