In PHP (running on a Windows server under IIS), I have a login page that authenticates the entered username/password against the Windows domain controller.
The code uses ldap_connect and ldap_bind against user input (username+password).
But I want the PHP code to automatically pull the logged in user, so they don't have to enter a username and password. The user would already be logged on the computer under a domain, using Internet Explorer.
How can I have PHP code automatically authenticate (in IE) against the logger in user on the Windows machine?
$_SERVER["AUTH_USER"] and $_SERVER["REMOTE_USER"] do not work, it only returns a blank string in IE.
I found I could use this Javascript:
ActiveXObject("WScript.Network")
(and then pulling the username) But that doesn't work for me, as it requires the user to have their ActiveX trust levels set correctly first (which loosens security for the user).