获得空白值$ _ SERVER ['AUTH_USER'] [英] Getting blank value for $_SERVER['AUTH_USER']

查看:176
本文介绍了获得空白值$ _ SERVER ['AUTH_USER']的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 2008 Server R2,它的用户进行身份验证对Active Directory运行的PHP应用程序使用PHP的LDAP库。

I have a PHP app running on Windows 2008 server R2, which authenticates users against Active Directory using PHP's LDAP library.

根据这个答案,我寻找使用 $ _ SERVER ['AUTH_USER'] ,但我发现它空值。同样为 AUTH_TYPE AUTH_PASSWORD 。该变量的声明,但他们都没有任何值分配给他们。

As per this answer, I'm looking to use $_SERVER['AUTH_USER'], but I'm getting a blank value for it. Same for AUTH_TYPE and AUTH_PASSWORD. The variables are declared, but none of them have any value assigned to them.

我已经启用了基本身份验证和Windows身份验证这两个角色(通过服务器管理器),但也已经解决了这个问题。

I've enabled both the Basic Authentication and Windows Authentication roles (through Server Manager), but neither has solved the issue.

我使用PHP 5.3.14,Zend服务器CE和IIS 7.5。

I'm using PHP 5.3.14, Zend Server CE and IIS 7.5.

我需要申请一个单点登录解决方案,但没有能够获取当前登录的用户的凭据,我不知所措。

I need to apply a single sign on solution, but without being able to fetch the currently logged in user's credentials, I'm at a loss.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

推荐答案

我把它通过禁用匿名身份验证在IIS中,并启用Windows身份验证(我以为Windows身份验证工作已经启动,但事实证明只不过是安装中的作用)。现在 $ _ SERVER ['AUTH_USER'] $ _ SERVER ['REMOTE_USER'] 填充。

I got it working by disabling Anonymous Authentication in IIS, and enabling Windows Authentication (I thought Windows Authentication was already enabled, but it turns out the role was simply installed.) Now $_SERVER['AUTH_USER'] and $_SERVER['REMOTE_USER'] are populated.

这篇关于获得空白值$ _ SERVER ['AUTH_USER']的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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