如何从 Perl 访问 HTTP 基本身份验证用户名?

发布于 2024-08-26 23:45:47 字数 55 浏览 7 评论 0 原文

我需要在我的 CGI 脚本中获取远程用户名。我在哪里可以找到它?我想在我返回的页面上显示该名称。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼眸里的那抹悲凉 2024-09-02 23:45:47

根据 CGI 规范,HTTP 身份验证用户名将位于环境变量 REMOTE_USER 中。在 Perl 中,您可以通过 $ENV{REMOTE_USER} 获取此信息。

您可以在 REMOTE_USER >RFC 3875

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.

梦明 2024-09-02 23:45:47

CGI 模块 中的 remote_user() 方法。

如果您不使用 CGI 模块,则环境变量 REMOTE_USER:$ENV{REMOTE_USER}

The remote_user() method in the CGI module.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文