简体   繁体   English

在IIS上使用PHP进行Windows身份验证

[英]Windows authentication with PHP on IIS

I'm Working on an Intranet application that is build in PHP on IIS. 我正在使用IIS上的PHP构建的Intranet应用程序。 I want to authenticate against an AD by passing the username automatically from the browser to the IIS using windows authentication. 我想通过使用Windows身份验证将用户名从浏览器自动传递到IIS来针对AD进行身份验证。 Is there anyway to do that? 反正有这样做吗?

Yes, IIS supports integrated Windows authentication. 是的,IIS支持集成的Windows身份验证。 Access the 'Authentication' option for your website... 访问您网站的“身份验证”选项...

IIS1

...and change the 'Windows Authentication' item to 'enabled' (and perhaps 'Anonymous Authentication' to 'disabled' if you want to force users to authenticate)... ...然后将“ Windows身份验证”项更改为“启用”(如果要强制用户进行身份验证,则可能将“匿名身份验证”更改为“禁用”)...

IIS2

More details are available on Technet . 有关更多详细信息,请访问Technet

In PHP the username should be populated in the $_SERVER superglobal. 在PHP中,用户名应填充在$_SERVER超全局变量中。 I think as AUTH_USER , but I can't confirm that right now. 我认为是AUTH_USER ,但目前无法确认。 Use var_dump($_SERVER); 使用var_dump($_SERVER); to find the correct key. 找到正确的钥匙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM