What is the best way to enable Integrated Windows Authentication for a PHP web application running on Apache2/Linux? There is a Windows Domain Controller in the network which should be used for authentication.
I found these apache modules:
But these modules seem to be very outdated (last updated 2007/2008). Is there a better, more up-to-date way to do this?
I believe WDC speaks LDAP, in which case you probably want mod_authnz_ldap instead.
The best option is mod_auth_sspi, it's reasonable up to date, most recently released in 2011.
I used mod_auth_sspi 1.0.4 with apache 2.2.9 on Windows Server 2003 and it works fine for Windows XP clients. They get logged in automatically. Here is my config, note that you don't need the SVN bit, but you can see how to restrict to specific groups.
I've spent a few hours searching here and there, and finally found the solution.
There is no need to install/enable any apaache modules.
As per the Integrated Windows Authentication Documentation, a response header from your webserver is all what you need.
If you set the
WWW-Authenticate
header in your virtual host configuration, and the server responds withHTTP/1.1 401 Unauthorized
, the client will retry the request withAuthorization
header line contains the base64 encoding of anInitialContextToken
.In your
vhost.conf
add the headerHeader set WWW-Authenticate 'Negotiate'
Don't forget to enable the headers module
a2enmod headers && service apache2 restart
Have a look on this document.