Grab username from IE, to authenticate against LDAP(从 IE 中获取用户名,以针对 LDAP 进行身份验证)
问题描述
用户将只使用 IE,并且在 IE 中,如果他们登录到域控制器,它可以在不提示的情况下传递他们的凭据.
The users will only use IE, and within IE it can pass their credentials without being prompted to, if they are logged onto the domain controller.
我想知道的是,我该如何获取他们的用户名?
What I want to know is, how do I go about grabbing their username?
我认为这可以解决问题:$_SERVER['auth_user'];
但没有运气.
I thought this would do the trick: $_SERVER['auth_user'];
but no luck.
就像这样 你能不能得到一个 Windows (AD)PHP 中的用户名?
但我不知道捕获/获取用户用户名的代码应该是什么样子
But I don't know what the code should look like this to capture/grab the user's username
感谢任何帮助.
推荐答案
没有办法直接用php解决问题,但是可以借助javascript获取用户名:
There is no way to solve the problem in php directly, but you can obtain the username with the help of javascript:
<script type="text/javascript">
<!--
var WinNetwork = new ActiveXObject("WScript.Network");
alert(WinNetwork.UserName);
//-->
</script>
只需添加一些 AJAX ;)
Just add some AJAX ;)
HTH
这篇关于从 IE 中获取用户名,以针对 LDAP 进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 IE 中获取用户名,以针对 LDAP 进行身份验证


基础教程推荐
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01