Search code examples
phpsql-serverwindowsiiswindows-authentication

is it possible to have windows authentication on a php site?


We are running an internal website on php 5.2 with IIS.

Currently each user is assigned a login. The login information is authorized with php confirming the information against a sql server database table.

PHP sends select statements to sql server using sql server authentication.

We would like to keep the sql server authentication; however, we want the users to be able to get onto the site using windows authentication.

How can we implement windows authentication on a php site?


Solution

  • You could use LDAP bindings for PHP to achieve this.

    Here is an example implementing this using the ldap_bind PHP extension.

    What this example achieves is using Active Directory to authenticate your clients against a directory service which is providing the list of the currently registered user on the Active Directory domain.