LDAP Dokumentace
Pouziti HKFree LDAPu pro autentizaci je vcelku jednoduche:
Obsah
BASH
Je treba nainstalovat (aspon v debianu) ldap-utils. Dalsi potrebna vec je pridat do /etc/ldap/ldap.conf toto:
BASE dc=hkfree,dc=org URI ldap://ldap.hkfree.org
TLS_CACERT /etc/ssl/certs/hkfree.crt TLS_REQCERT try
Nyni si stahnete z http://igw.hkfree.org/hkfree.crt do adresare /etc/ssl/certs/ a doinstalujte (v pripade potreby) balik openssl
Jednoduchy test, jestli vse chodi je napriklad:
ldapsearch -U uMOJE_ID -ZZ -h ldap.hkfree.org
Zmena hesla se da provest pomoci:
ldappasswd -U uMOJE_ID -ZZ -h ldap.hkfree.org -S
atd.
PERL
viz [1]
use Net::LDAP; use Authen::SASL;
my $ldapserver = "ldap://ldap.hkfree.org"; my $password = "heslo"; my $user = "uzivatel"; my $dn = "dc=hkfree,dc=org";
my $ldap = Net::LDAP->new($ldapserver, onerror => 'die' );
$ldap->start_tls(
$verify => 'require' );
my $sasl = Authen::SASL->new(
mechanism => 'CRAM-MD5 PLAIN ANONYMOUS', callback => { pass => $password, user => $user, }
);
my $mesg = $ldap->bind( $dn, sasl => $sasl, version => 3 );
PHP
viz