For ASP.NET MVC you should ActiveDirectory membershipProvider. Check this
MSDN for more information, how to use and configure it. You have several ways to implement this:
- with Windows authentication, which basically tells to the browser to handle the authentication process for you (gathering the username and password from the user)
- with Form authentication, where you have to implement your custom form in order the user to be able to provide you with his username and password.
For PHP you integration will be not so out-of-the-box. To be honest I've never tried this, but you should deal with the LDAP object to be able to integrate your Active Directory. You can try this article for more info.