你可以在PHP在Windows(AD)用户名? [英] Can you get a Windows (AD) username in PHP?

查看:143
本文介绍了你可以在PHP在Windows(AD)用户名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Intranet,可以提取该网页上的当前用户的IP地址和主机名的PHP Web应用程序,但我想知道如果有一种方式来获得/提取其Active Directory / Windows用户名以及。这可能吗?

I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?

推荐答案

检查 AUTH_USER 请求变量。这将是空的,如果你的Web应用程序允许匿名访问,但如果您的服务器使用基本或Windows集成身份验证,它将包含身份验证的用户的用户名。

Check the AUTH_USER request variable. This will be empty if your web app allows anonymous access, but if your server's using basic or Windows integrated authentication, it will contain the username of the authenticated user.

在Active Directory域中,如果您的客户端运行Internet Explorer和您的Web服务器/文件系统权限配置正确,IE会悄悄地提交自己的域凭据到您的服务器和 AUTH_USER MYDOMAIN \\ user.name 未经用户不必明确登录到你的Web应用程序。

In an Active Directory domain, if your clients are running Internet Explorer and your web server/filesystem permissions are configured properly, IE will silently submit their domain credentials to your server and AUTH_USER will be MYDOMAIN\user.name without the users having to explicitly log in to your web app.

这篇关于你可以在PHP在Windows(AD)用户名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆