Results 1 to 9 of 9

Thread: ASP Question

  1. #1
    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.

  2. #2
    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?

  3. #3
    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.

  4. #4
    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.

  5. #5
    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.

  6. #6
    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.

  7. #7
    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.

  8. #8
    Join Date
    May 2002
    Posts
    49
    Sorrie for the confusing.. Is it possible to get just the Username? I dont want the password. Thanks.

  9. #9
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •