We were able to get remotedoauth to work with adLDAP using the following code. Please keep in mind I'm not a programmer so I can not say if this is the proper way of going about it. This does populate the desired values and we used the employeeid field in AD because it is usually a unique numerical value. It MUST be filled in and cannot be blank before it will work. When we tried the $user['remote_user_id'] = 1, a new user login would overwrite another user or would error out.
function remoteDoAuth($username, $password) {
require_once 'custom/adLDAP.php';
$auth = false;
oif(empty($username) || empty($password)) {
oreturn $auth;
o}
$username = addslashes($username);
o$password = addslashes($password);
//create the AD LDAP connection
o$adldap = new adLDAP();
// if found
oif($adldap->authenticate($username, $password)){
o// remote_user_id is a unique id for user in your system (integer)
// get user info
$userinfo = $adldap->user_info($username, array("sn","givenname","mail","employeeid"));
ame'] = $userinfo[0]['givenname'][0];
o$user['last_name'] = $userinfo[0]['sn'][0];
o$user['email'] = $userinfo[0]['mail'][0];
o$user['username'] = $username;
o$user['password'] = $password;
o$user['remote_user_id'] = $userinfo[0]['employeeid'][0];
a priv to user (optional)
o// it is fully up to you how to determine who is authenticated and what priv to
assign
o$user['priv_id'] = 3;
a role to user (optional)
o// it is fully up to you how to determine who is authenticated and what role to
assign
o$user['role_id'] = 1;
o}
return $user;
}
?>
Hope this saves someone else some time and effort.