Getting AD username from client

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
 
J

Jon

Thanks for the info. Could you give a pointer or a link with a good
description on what is involved with turning on impersonation.
 
U

Urso

If you have all the authentication set up properly. you can use:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top