Re: mod_perl, PerlAuthenHandler and REMOTE_USER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Feb 2008, Neil A. Hillard wrote:

Hi,

I've been having a dabble, using a perl module to handle some of our authentication requirements. I have the perl auth handler working successfully but the username is not logged in access_log.

I have the following code in my perl module:

my $username = "test_user";
$r->user($username);

return OK;

I can see from my PHP script that the REMOTE_USER variable has been set successfully.

I am using the following LogFormat for access_log:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

Any pointers as to how I can get the username logged in access_log?

Many thanks in advance,


				Neil.



I found it necessary to do the following in my Perl auth handler as well as $r->user($username) (assuming Apache2 API):

$r->subprocess_env('REMOTE_USER' => $username);
$r->set_basic_credentials($username, $password);

I can't exactly recall the reasons, something about which process (parent or child) writes the environment variables vs. which process does the logging, or perhaps the order in which Apache sets variables and writes to the log. Or perhaps it was just overkill on my part, not wanting to miss anything. But it's working for me.


--
Craig Dunigan
IS Technical Services Specialist
Middleware - EIS - DoIT
University of Wisconsin, Madison

opinions expressed are my own, not the University's


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux