httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey <>
Subject Re: [users@httpd] do I have access to the user id used in basic authentication?
Date Fri, 06 Feb 2004 17:36:01 GMT
Boyle Owen wrote:
>>-----Original Message-----
>>From: Geoffrey []
>>Sent: Freitag, 6. Februar 2004 15:58
>>Subject: [users@httpd] do I have access to the user id used in basic
>>I'm using basic authentication to control access to some 
>>sections of a 
>>web site.  I would like to be able to determine the user id that was 
>>used to log in, so I can customize the response.  Is this information 
>>available when the page loads?
> This info is stored as an environment variable. If you're using perl,
> you can access it via the %ENV hash, ie, $ENV{REMOTE_USER}.

Thanks, for the reference to the env var, it was the clue that provided 
the solution.

The initial page is static html, but it's a form that's processed by 
perl.  Here's my solution using server side includes, since I wanted to 
be able to pass the value as an input to the cgi:

<input type="hidden" name="userid"
value="<!--#echo var="REMOTE_USER"-->">

I wrapped it to fit the email, but in the code, it was all on one line.

Which produces the following in the html nicely:

<input type="hidden" name="userid" value="esoteric">

Until later, Geoffrey                     Registered Linux User #108567
Building secure systems inspite of Microsoft

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message