gpt4 book ai didi

php - AUTH_USER 与 LOGON_USER 与 REMOTE_USER

转载 作者:太空宇宙 更新时间:2023-11-04 11:52:13 25 4
gpt4 key购买 nike

我希望能够在登录用户访问我们的网站时获取他们的信息,这样他们就不需要登录了。有人告诉我,只有当你在 Windows IE 上时,它才可能在 I.E 中。一旦他们使用 Windows 凭据登录。

我已经在网上搜索了所有这三个($_SERVER['AUTH_USER']$_SERVER['LOGON_USER']$_SERVER ['REMOTE_USER']) 已被推荐,所以我不确定要检查哪一个。

其次,我正在使用带 IIS 的 Windows 服务器,但无论我在网上尝试过和搜索过什么,都无济于事。我可以在 $_SERVER 中看到变量,但以上都是空字符串。

我该如何解决这个问题?

作为引用,我正在使用 windows server 2012 和 php v7.1

同样在我的 php.ini 文件中,我看到它们都具有以下值。

$_SERVER['LOGON_USER']:无值(像这样)

但我也搜索过如何在 .ini 文件中设置这些,但运气不佳。

header('WWW-Authenticate: NTLM', true);


// with this die there is a user and password prompt
// if i click cancel then it sends the information through to the
// server vars as expected.
// when we cancel here it registers as two requests as my logs in the
// log shows up two times.

// without it the login page loads with symfony but no values ever
// come through and i cant log in the user.
die();

最佳答案

AUTH_USER

在用户名映射到 Windows 帐户之前,用户名源自客户端发送的授权 header 。此变量与 REMOTE_USER 没有区别。

LOGON_USER

唯一一次 LOGON_USER 持有与这些其他变量不同的值是在您安装了身份验证过滤器的情况下。

https://msdn.microsoft.com/en-us/library/ms524602(v=vs.90).aspx

关于php - AUTH_USER 与 LOGON_USER 与 REMOTE_USER,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55754016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com