I need to get the remote user name in my CGI script. Where do I find that? I want to display that name on the page that I return.
Under the CGI spec, the HTTP-auth user name will be in the environment variable REMOTE_USER
. In Perl you can get this via $ENV{REMOTE_USER}
.
You can find descriptions of all the standard CGI environment variables, including REMOTE_USER
, in section 4 of RFC 3875.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With