PDA

View Full Version : Get the Client login name?


jenagan
Aug 15, 2005, 12:16 AM
Dear all,

I need to get the Client system login name to display in each client pages..
I have tried following code it display nothing.. :(

You are <%=Request.ServerVariables("LOGON_USER")%>

Please anybody suggest right idea to solve this problem..

jena.

LTheobald
Aug 15, 2005, 04:22 AM
From 4GuysFromRolla (link (http://www.4guysfromrolla.com/webtech/092298-3.shtml)):

Here is the answer:

Try Request.ServerVariables("LOGON_USER").

And this is exactly what you should do. If you turn on the directory security through the IIS Administration Console, user's will be prompted to enter their username and password (you must have the clear text option selected if you want to make it Netsca pe compatible. You can also select the NT Challenge / Response, which will work with Internet Explorer). Once they enter their name and password, it will check to see if the user has an NT account on the webserver, and if they've entered the correct pas sword. Once they are validated, you can view who they are, exactly, using Request.ServerVariables("LOGON_USER").

Have you turned on the directory security? Are you getting a popup asking for the user's name and password? That line on it's own will not retrieve their login name that they use to access the PC.

jenagan
Aug 15, 2005, 10:19 PM
Thank you V.Much LTheobald,

It worked after did that changes.. but still I have problem,
I'm working with Windows XP, IIS version 5.1.
When I run this in a client mechine it took the login name as what I entered in the popup, and its not checking the password ever.

I actually need to validate with each PC their own login username and password.. is that possibe? Or do I need to have any domin login? Or Windows server is required?

LTheobald
Aug 16, 2005, 04:06 AM
If you want the password, use Request.ServerVariables("LOGON_PASSWORD")

I'm sure it is possible to validate a user's details against their domain but I've never done it using ASP. Try searching Google for something like "ASP user validate domain". Also check out this link - http://www.aspin.com/home/tutorial/usermanage. Hopefully you will be able to find something in there.

Sorry I can't give you something miore useful.