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 进行身份验证
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
