How can I connect throw php to an active directory, and make user authentication ? I have tried LDAP locally using WAMP but no success so far, maybe doing it wrong ?
I tried this:
$link = ldap_connect( 'domain.com' ); // Your domain or domain server
if( ! $link )
{
// Could not connect to server - handle error appropriately
}
ldap_set_option( $link, LDAP_OPT_PROTOCOL_VERSION, 3 ); // Recommended for AD
// Now try to authenticate with credentials provided by user
if ( ! ldap_bind( $link, 'username@domain.com', 'SomeSecret' ) )
{
// Invalid credentials! Handle error appropriately
}
// Bind was successful - continue
changing the domain for my active directory domain "davidecuriosidade.onmicrosoft.com", but as I said no success. Is any configuration on my active directory ?