http://www.perlmonks.org?node_id=1017530


in reply to Re^2: Obtaining Windows username from an intranet ActiveState Perl script
in thread Obtaining Windows username from an intranet ActiveState Perl script

Its like any other authentication scheme, the user supplies the username and a password. Or does Apache2::AuthenNTLM somehow read the mind of the person on the other end of the network and determine their window's username? Not even windows can get a person username until they type it in to the login screen. Maybe what you are looking for is a single sign on solution. If so why didn't ask about that? I have used products from Quest http://www.quest.com/identity-management/ that handle Apache authentication with Window credentials but its not free or opensource.

Replies are listed 'Best First'.
Re^4: Obtaining Windows username from an intranet ActiveState Perl script
by saa (Initiate) on Feb 07, 2013 at 00:55 UTC

    Because the users are on intranet and it's a Microsoft IT environment, their browser automatically identifies who they are (I believe using NTLM authentication).

    Using ASP, the variable is HttpContext.Current.User

    The original post that I linked to also describes this scenario (where the intranet user never has to supply their username/password to the site, but the site can still obtain it).

      So, you're running this "perl script" under what environment? Have you looked inside %ENV?
        I am running this script using Apache Web Server on Windows. I have tried the code that displays all variables inside of %ENV, but in terms of identifying the users that shows only their IP and not their username.