adLDAP - LDAP authentication with PHP for Active Directory Logo

adLDAP Developer API Reference

This documentation relates to version 4.0 branch of adLDAP. Version 4 is not backwards compatible with code written for prior versions. For documentation on versions prior to version 4.0, please visit this page

This API is intended to be an accurate representation of the current version of the class. A great deal of knowledge is involved in the LDAP schema, so we actively encourage people to add to this documentation if you are able to improve it….

Version 4.0 of adLDAP is a complete re-write of the library and is not backwards compatible with older versions. Please take time to read the documentation to see how to use this class.

By Meda Joker 2013

Server Requirements

Using adLDAP

Read the documentation on connecting and disconnecting from your domain controller for more information on different ways of calling adLDAP.

  1. Copy the contents of the src folder to your server
  2. Edit the configuring variables in the class itself if you so wish to
  3. From your script add the following code
require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP\adLDAP();

It would be better to wrap it in a try/catch though

try {
    $adldap = new adLDAP\adLDAP();
catch (adLDAPException $e) {
    echo $e;

You can alternatively override the configuration when the class is called by specifying an array with the options.

Called like $adldap = new adLDAP\adLDAP($options); Where $options is an array with one or more of the following keys

account_suffix base_dn domain_controllers admin_username admin_password real_primarygroup use_ssl use_tls recursive_groups ad_port sso

See the 'examples' and 'connecting and disconnecting' section for more information

API Function Reference Guide

Calling adLDAP


Error Handling

Active Directory Schema


documentation.txt · Last modified: 2015/10/08 20:22 by
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki