Kevin Schroeder has a new post to his site showing an (almost) stupid easy Active Directory integration method on the Windows Azure service via PHP.
There is something nice about simply having to go to one company and say “I need X” and, lo, you have it. Clearly that’s an over-simplification and, to some degree, a lie, but for the Microsoft developers I’ve talked to who have had to make the switch to PHP that is one of the things that they have said the liked better about Microsoft.This is a simple library that uses the league/oauth2-client to provide OAuth2 based integration with Active Directory. Out of the box it is configured to work with Active Directory on Azure but, though I haven’t tested it, you can provide a different configuration object to the primary adapter and you should be able to authenticate against any Active Directory implementation as long as it has OAuth2 connectivity.
If you haven't worked with Azure's Active Directory before, he includes an instructional video of how to get it set up first. With that in place he shows an example of using the library to make the authentication request to the AD server and how to log back out. He also includes the code you'll need to configure the library via the Magium Configuration Manager or, for those without Magento experience, with some alternate methods: PHP arrays, JSON, YAML or INI files.