Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you access the HTTP basic authentication username from perl?

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.

like image 751
user105033 Avatar asked Mar 29 '10 16:03

user105033


1 Answers

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.

like image 80
friedo Avatar answered Nov 14 '22 23:11

friedo