Results 1 to 9 of 9
Thread: ASP Question
-
08-05-2002, 01:01 PM #1Junior Guru Wannabe
- Join Date
- May 2002
- Posts
- 49
ASP Question
Could someone write a quick asp script that takes the username and password from the current log in user? I'm a newbie an very clueless. Thanks.
-
08-05-2002, 01:07 PM #2Junior Guru Wannabe
- Join Date
- May 2002
- Location
- Ontario
- Posts
- 44
Which current logged in user are you talking about? The user that is logged into Windows, or the user that is logged into your site through another ASP page?
-
08-05-2002, 01:28 PM #3Junior Guru Wannabe
- Join Date
- May 2002
- Posts
- 49
I want to get the user that is accessing the asp page login and password (the login when he signs on to his machine).
The reason i'm taking his windows logon username and password so i can pass those variables to another application.
-
08-05-2002, 01:31 PM #4Junior Guru Wannabe
- Join Date
- May 2002
- Location
- Ontario
- Posts
- 44
OK, then that would probably be stored in a session variable by the login page, such as
Session("uid") and Session("pw")
You only need to access those session variables to get the username and password.
If you aren't storing the username and password with the login page, then you should change it to do that so you can access this info on other pages.
Hope this helps.
-
08-05-2002, 02:49 PM #5Temporarily Suspended
- Join Date
- Oct 2000
- Location
- UK
- Posts
- 318
I think you are looking for:
Request.Servervariables("AUTH_USER")
and
Request.Servervariables("AUTH_PASSWORD")
I think its this one. It will only work with basic authentication though.
-
08-06-2002, 02:55 PM #6Junior Guru Wannabe
- Join Date
- May 2002
- Posts
- 49
I use Request.Servervariables("AUTH_USER")
and why it doesn't give me anything? is there something that I have to set to in the IIS webserver?
The ALL_HTTP gives me the header info though. Your help is appreciated.
-
08-06-2002, 05:37 PM #7Web Hosting Guru
- Join Date
- Jul 2002
- Location
- The Big Easy -New Orleans
- Posts
- 341
>(the login when he signs on to his machine).
Looks like he means the Windows itself name/password (or NT domain or Netware, etc.).
I don't think you can do this... For one thing it would be a HUGE security hole. Image getting this info from someone who was on a dedicated line of some type, dsl w/static ip, DS-x, OC-x network, etc. If file sharing was on, you have access to everything on the machine he did. And it's not like file sharing or windows needs any more security holes than they've got already.
-
08-06-2002, 06:17 PM #8Junior Guru Wannabe
- Join Date
- May 2002
- Posts
- 49
Sorrie for the confusing.. Is it possible to get just the Username? I dont want the password. Thanks.
-
08-06-2002, 09:09 PM #9Aspiring Evangelist
- Join Date
- Aug 2002
- Location
- Sacramento, CA
- Posts
- 353
Is this for an internet site or like a company's intranet? If it is just an intranet and you have NT user logins, you can use the Request.ServerVariables("LOGON_USER") variable for the username. You might have to strip the domain off it, something like:
dim sUserID
dim iBackSlashPosition
iBackSlashPosition = instr(1, request.servervariables("LOGON_USER"), "\")
sUserID = mid(request.servervariables("LOGON_USER"), iBackSlashPosition + 1, len(request.servervariables("LOGON_USER")))
That's probably not the most efficient, just pulled it from some code I had.