开发者

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

开发者 https://www.devze.com 2022-12-25 13:43 出处:网络
I need to get the remote user name in my CGI script. Where do I find that? I want to display that name o开发者_开发百科n the page that I return.Under the CGI spec, the HTTP-auth user name will be in t

I need to get the remote user name in my CGI script. Where do I find that? I want to display that name o开发者_开发百科n 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.


The remote_user() method in the CGI module.

If you're not using the CGI module, the environment variable REMOTE_USER: $ENV{REMOTE_USER}

0

精彩评论

暂无评论...
验证码 换一张
取 消