问题
I'm Working on an Intranet application that is build in PHP on IIS. I want to authenticate against an AD by passing the username automatically from the browser to the IIS using windows authentication. Is there anyway to do that?
回答1:
Yes, IIS supports integrated Windows authentication. Access the 'Authentication' option for your website...
...and change the 'Windows Authentication' item to 'enabled' (and perhaps 'Anonymous Authentication' to 'disabled' if you want to force users to authenticate)...
More details are available on Technet.
In PHP the username should be populated in the $_SERVER
superglobal. I think as AUTH_USER
, but I can't confirm that right now. Use var_dump($_SERVER);
to find the correct key.
来源:https://stackoverflow.com/questions/26735047/windows-authentication-with-php-on-iis