Getting AD username from client

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I am trying to figure out how to get the client's AD username.

So far everything I've found with google boils down to the following:
System.Environment.UserName
System.Security.Principal.WindowsIdentity.GetCurrent.Name

But, they always give me the username ASPNET, which is what the IIS process
runs as. How do I get the user's username without them having to type it in.
What I'm trying to do is build an intranet website (without forms auth) that
will seemlessly log the user in using their AD credentials without the user
having to type anything into the website, simply go tothe URL and it picks
up the AD username and checks that against our SQL database.

Thanks
 
Thanks for the info. Could you give a pointer or a link with a good
description on what is involved with turning on impersonation.
 
If you have all the authentication set up properly. you can use:

user.Identity.Name or Request.Params("LOGON_USER")
 
Back
Top