0

I was trying to authenticate vTiger CRM 6.5 with my existing Active Directory services, but it's not working. Looks like this is getting response from my AD server but not going anywhere. After using correct credential the page will just refresh, but once you enter wrong credential, it says - "wrong username or password". I am using "http://adldap.sourceforge.net/" for AD authentication. And my log says -

03/28/17 15:24:50,105 [632] DEBUG user - Entering Users() method ...
03/28/17 15:24:50,105 [632] DEBUG VT - Entering getColumnFields(Users) method ...
03/28/17 15:24:50,105 [632] DEBUG VT - in getColumnFields Users
03/28/17 15:24:50,105 [632] DEBUG VT - Prepared sql query being executed : SELECT tabid, name, ownedby FROM vtiger_tab
03/28/17 15:24:50,110 [632] DEBUG VT - Prepared sql query being executed : SELECT tabid, fieldname, fieldid, fieldlabel, columnname, tablename, uitype, typeofdata, presence
        FROM vtiger_field WHERE tabid in (?)
03/28/17 15:24:50,110 [632] DEBUG VT - Prepared sql query parameters : [29]
03/28/17 15:24:50,122 [632] DEBUG VT - Exiting getColumnFields method ...
03/28/17 15:24:50,122 [632] DEBUG user - Exiting Users() method ...
03/28/17 15:24:50,123 [632] DEBUG user - Using Active Directory authentication
03/28/17 15:24:51,361 [632] DEBUG VT - Prepared sql query being executed : SELECT id from vtiger_users where user_name=? AND deleted=0
03/28/17 15:24:51,361 [632] DEBUG VT - Prepared sql query parameters : [pritamkumar]
03/28/17 15:24:51,436 [632] DEBUG VT - Prepared sql query being executed : SELECT * FROM vtiger_tab
03/28/17 15:24:51,448 [632] DEBUG VT - Prepared sql query being executed : SELECT fieldname,modulename,tablename,entityidfield,entityidcolumn from vtiger_entityname
03/28/17 15:24:51,453 [632] DEBUG VT - Prepared sql query being executed : INSERT INTO vtiger_loginhistory (user_name, user_ip, logout_time, login_time, status) VALUES (?,?,?,?,?)
03/28/17 15:24:51,453 [632] DEBUG VT - Prepared sql query parameters : [pritamkumar,::1,0000-00-00 00:00:00,2017-03-28 15:24:51,Signed in]
03/28/17 15:24:51,818 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:52,438 [632] DEBUG VT - Login is required:#0 E:\xampp\htdocs\vtiger\includes\main\WebUI.php(186): Vtiger_WebUI->checkLogin(Object(Vtiger_Request))
#1 E:\xampp\htdocs\vtiger\index.php(18): Vtiger_WebUI->process(Object(Vtiger_Request))
#2 {main}
03/28/17 15:24:52,653 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:54,160 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:55,028 [632] INFO VT - PearDatabase ->ADODB disconnect

2 Answers2

1

To test adLDAP, write a small php script than doing it directly with vTiger CRM. Just create adldap_test.php file, in the same directory where adLDAP.php resides, with following content:

<?php

require_once(dirname(FILE) . '/adLDAP.php');

try {
    $adldap = new adLDAP();
} catch (adLDAPException $e) {
    echo $e;
    exit();
}
$authUser = $adldap->authenticate('user-to-authenticate', 'users-password');
if ($authUser == true) {
     echo "User authenticated successfully";
} else {
   // getLastError is not needed, but may be helpful for finding out why:
    echo "\n";
    echo $adldap->getLastError();
    echo "\n";

    echo "User authentication unsuccessful";
}

echo "\n";
$result=$adldap->user()->infoCollection('ldap', array("*"));
echo "User:\n";
echo $result->displayName;
echo "Mail:\n";
echo $result->mail;

?>

Replace user and password for the user you want to test authentication for and execute it. It should give success and output the username and mail address if available. Hope this helps you to solve your problem.

Milan Malani
  • 1,818
  • 1
  • 22
  • 34
  • Hi Milan, Thanks for answering. But I have already checked this (http://adminberlin.de/vtiger-crm-6-active-directory-authentication/) it's not helping. – Pritam Kumar Mar 31 '17 at 11:28
0

You must enable php-ldap extension on your server. please check adldap project requirements https://github.com/adldap/adLDAP/wiki/Apache-configuration

you can use the following links for install ldap on your server

Ldap configuration on xammp

Using php-ldap in Centos 6.3

Unable to enable PHP LDAP even though I have edited php.ini and php_ldap.dll is in the right place?

Community
  • 1
  • 1
Hamid
  • 378
  • 3
  • 8