You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Wong, Connie" <co...@lmco.com> on 2002/02/26 16:01:29 UTC
How to get a remote user from the mod_perl + SSL?
Hello,
I'm running mod_perl with Apache-SSL on Solaris 8.
I setup a self-certificate for the basic authentication.
I want to get the login name from the client (REMOTE_USER).
In CGI, there is an environment variable $ENV{REMOTE_USER} that I can use.
In mod_perl with SSL, how do I get the remote user after the user was
validated?
Can someone provide an example how to get it?
Thanks in advance,
Connie
Re: How to get a remote user from the mod_perl + SSL?
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
"Wong, Connie" wrote:
>
> Hello,
>
> I'm running mod_perl with Apache-SSL on Solaris 8.
> I setup a self-certificate for the basic authentication.
> I want to get the login name from the client (REMOTE_USER).
> In CGI, there is an environment variable $ENV{REMOTE_USER} that I can use.
> In mod_perl with SSL, how do I get the remote user after the user was
> validated?
> Can someone provide an example how to get it?
you can use that same environment variable under Apache::Registry...
just put
PerlSetupEnv On
in your httpd.conf, such as
<Location /perl-bin>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSetupEnv On
...
</Location>
if you mean by using the mod_perl API you can use
my $remote_user = $r->user;
I'm fairly certain that the steps are the same, regardless of your SSL
settings.
HTH
--Geoff