Querying AD for a user's log-in name...

  • Thread starter Thread starter ckpicker
  • Start date Start date
C

ckpicker

Is it possible to retrieve a user's log-in name from AD when they
visit a particular website? I'm wanting to store exactly who clicked
on certain links and when they clicked them. Is this possible? I
know very little about AD, so any help would be appreciated. Thanks!
:)
 
When you are not using anonymous credentials, the username is passed in the
server variables collection when it is known.

It is normally passed by the browser using passthrough authentication (ntlm)
or basic authentication or an authentication challenge (403 response) is
issued and the user needs to provide valid credentials. It is then checked
behind the scenes by IIS for authentication and if succesful the server
variables collection should now contain the username.

You dont have to talk directly to AD from your code, and what they clicked
will be in the webserver logs.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
Yes, it is possible. However, it is not necessary. As you already know their
login name (passed by the browser with authentication), you already have a
unique identifier for that user which you can use to store information
specific to that user in the database. Fetching more infomation about them
from Active Directory should not be necessary if all you are doing is
tracking them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top