Skip to content

MatHermann/php-ldap-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My-CoolPay PHP SDK

Latest version on Packagist Total downloads Licence PHP version
Easily authenticate users and deal with LDAP server in PHP

Usage

<?php

require_once 'vendor/autoload.php';

use MatHermann\Ldap\Exception\LdapException;
use MatHermann\Ldap\LdapClient;

try {
    $host = '127.0.0.1';
    $port = 389;
    $dn = 'DC=yourDomain,DC=com';
    $OU = 'yourOrganizationalUnit';

    $username = 'yourUsername';
    $password = 'yourPassword';

    $client = new LdapClient($host, $port, $dn);

    $user = $client->signInUser($username, $password, "OU=$OU");

    var_dump($user); // Access user properties with $user->get('property')

} catch (LdapException $exception) {
    var_dump($exception); // Handle LDAP exceptions
}

About

Easily authenticate users and deal with LDAP server in PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages