KBPublisher Demo
Search:     Advanced search

Using Active Directory for Remote Authentication

Article ID: 182
Last updated: 10 Jan, 2008
Add comment
Views: 21
Comments: 0

It is possible to use Remote Authentication with your your LDAP server.

Before you start:

  • We assume that you have some experience with remote authentication, with PHP, and with lightweight directory access protocols (LDAP).

Requirements

LDAP support in PHP is not enabled by default. You will need to enable it. For more details check PHP documentation at http://php.net/ldap.

You may want to use Active Directory/PHP Helper library from http://adldap.sourceforge.net. If you do want to use it, download the library and place it into the kb_installation_dir/admin/lib/custom directory.

Here is an simple example of the function customized to authenticate against a LDAP server:

function remoteDoAuth($username, $password) {

require_once 'custom/adLDAP.php';

$auth = false;
if(empty($username) || empty($password)) {
return $auth;
}

//create the AD LDAP connection
$adldap = new adLDAP();

// if found
if($adldap->authenticate($username, $password)){
$user = 1; // assign a user id, this user id should exist in kb user table
}

return $user;
}



You can find more examples in kb_installation_dir/admin/lib/custom directory.
This article was:  
Add comment
Prev   Next
Using Remote Authentication     Different ways for Remote Authentication