LDAP

docker pull osixia/openldap

docker run --rm --env LDAP_TLS=false --env LDAP_ORGANISATION="vocus" --env LDAP_DOMAIN="vocus.com.au" --env LDAP_ADMIN_PASSWORD="pass" -p 389:389 -p 689:689 --name myldap --detach osixia/openldap

docker exec myldap ldapsearch -x -H ldap://localhost -b dc=vocus,dc=com,dc=au -D "cn=admin,dc=vocus,dc=com,dc=au" -w pass

GUI client

add new user

prepare

apt-get install migrationtools

PHP sample

$ldaprdn  = 'user@domain';

$ldappass = 'password';

$ldapconn = ldap_connect("server.address", 389) or die("Could not connect to LDAP server.");

ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);

if ($ldapconn) {

    // binding to ldap server
    $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass) or die("can not bind");

    // verify binding
    if ($ldapbind) {
        echo "LDAP bind successful...";
    } else {
        echo "LDAP bind failed...";
    }

}