从IE抓取用户名,以针对LDAP进行身份验证 [英] Grab username from IE, to authenticate against 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.
但是我不知道代码应该是什么样子来捕获/获取用户名
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进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!