How do you access the HTTP basic authentication us

2019-04-10 03:01发布

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.

2条回答
Anthone
2楼-- · 2019-04-10 03:54

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.

查看更多
等我变得足够好
3楼-- · 2019-04-10 04:03

The remote_user() method in the CGI module.

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

查看更多
登录 后发表回答