Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Pb ldap_bind to ser...
 
Notifications
Clear all

Pb ldap_bind to server

27 Posts
3 Users
0 Reactions
28.2 K Views
(@002514)
Posts: 68
Active Member
Topic starter
 
[#1545]

Hi

Allow me to put this new topic even if I've already seen an other topic for almost the same problem because I didn't find a solution.

After to have check all parameters, I have the following error :
2014-01-07 11:51:22 ** ERROR ** cause = ldap_bind(): Unable to bind to server: Can't contact LDAP server

Thank you for your help

Yannick


 
Posted : 07 Jan 2014 15H01
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Message seems clear "Can't contact LDAP server".
So either your definition of LDAP host or LDAP port is wrong, or your server cannot reach this defined server (some firewall may be blocking flows).


 
Posted : 07 Jan 2014 16H42
(@002514)
Posts: 68
Active Member
Topic starter
 

I tried with next command : "telnet domain 389" and the system respond
The firewall is disable
I have activated the extension module in PHP php_ldap
Is-it possible to have more details in log file ?

Thank you
Yannick


 
Posted : 07 Jan 2014 19H00
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

If you have version 4.1.0, you can uncomment all the debugLog commands in /model/User.php, enable debug log (set $logLevel=3 in parameters.php) and try again.


 
Posted : 07 Jan 2014 19H39
(@002514)
Posts: 68
Active Member
Topic starter
 

I modified the paramaters to activate the debug mode.
The result is :

2014-01-22 16:55:13 ----- DEBUG ----- ** trace binding admin **
2014-01-22 16:55:13 ----- DEBUG ----- user='cn=Manager,dc=mydomain,dc=com'
2014-01-22 16:55:13 ----- DEBUG ----- password='secret'
2014-01-22 16:55:14 ** ERROR ** ERROR **
2014-01-22 16:55:14
** ERROR ** on file 'E:wampwwwprojeqtormodelUser.php' at line (746)
2014-01-22 16:55:14
** ERROR ***** cause = ldap_bind(): Unable to bind to server: Can't contact LDAP server

I don't understand why the parameters used by ldap connection don't correspond with the parameter that i put with the global parameter screen.

Thank you


 
Posted : 22 Jan 2014 19H05
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

please check your parameters.php file : if the parameter exists in this file, it preceeds value in the database (as of config screen).


 
Posted : 22 Jan 2014 19H44
(@002514)
Posts: 68
Active Member
Topic starter
 

OK now it's working
I modified some parameters in the parameters.php and now it's OK
So, i think that some parameters are read in the parameters.php file and others directly in the database.

Thank you for your help

A fix to correct this mistake will necessary
Yannick


 
Posted : 22 Jan 2014 20H17
 Soji
(@soji)
Posts: 21
Active Member
 

Hello,

Please, can you copy your paramaters.php file because I have still problem with ldap connection.

In my parameters.php file, I have only these entries:
$paramDbType='mysql';
$paramDbHost='localhost';
$paramDbPort='3306';
$paramDbUser='root';
$paramDbPassword='secret';
$paramDbName='projeqtor';
$paramDbPrefix='';
$logFile='../files/logs/projeqtor_${date}.log';
$logLevel='3';

Thanks for your help.


 
Posted : 23 Jan 2014 14H11
(@002514)
Posts: 68
Active Member
Topic starter
 

You must modify the parameters.php file which is in the folder : filesconfig

$paramLdap_base_dn = 'DC=cb,DC=societe,DC=fr';
$paramLdap_host = 'host controleur active Directory';
$paramLdap_port = '389';
$paramLdap_version = '3';
$paramLdap_search_user = 'CN=_ReadOnly Active Directory,CN=Users,DC=cb,DC=canon,DC=fr';
$paramLdap_search_pass = 'password';
$paramLdap_user_filter = 'sAMAccountName=%USERNAME%';

Yannick


 
Posted : 23 Jan 2014 15H04
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

1) parameters.php file is by default in {projeqtorroot}/files/config, but it may be moved, and it is highly advised to move it ousite web reach.
Its location is stored in {projeqtorroot}/tool/parametersLocation.php

2) My advise is to comment the $paramLdap_* vars in parameters.php file.
this way, you'll be able to configure LDAP access through "Global Parameters" application screen.


 
Posted : 23 Jan 2014 15H14
 Soji
(@soji)
Posts: 21
Active Member
 

002514, can you try to connect with your AD account without entering your password? 😉


 
Posted : 23 Jan 2014 19H35
(@002514)
Posts: 68
Active Member
Topic starter
 

Hi

effectively, I needn't to put password to enter in the web site :angry:

thank you

I'm looking for a solution.... please


 
Posted : 23 Jan 2014 20H08
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Some issue has already been reported, looking like your own :
http://www.projeqtor.org/index.php/forum/2-submit-issues/5498-problem-ldap-authentication#6598


 
Posted : 23 Jan 2014 20H12
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Which version are you using ?

This issue should be trapped in V4.1.2...


 
Posted : 23 Jan 2014 20H20
(@002514)
Posts: 68
Active Member
Topic starter
 

I use the 4.1.2 version

I don't understand your last answer because for me i have a specific user used to connect to AD and other parameter like user filter for each user profil.
I defined this parameter like that : sAMAccountName=%USERNAME%

thanks


 
Posted : 23 Jan 2014 20H28
 Soji
(@soji)
Posts: 21
Active Member
 

I use the 4.1.2 version too.

I modified and tried any filter but I have already the problem... 🙁


 
Posted : 23 Jan 2014 20H42
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

@soji & 002514 :
try to uncoment all debugLog() lines in /model/user.php.
then set debogLevel=3; (in parameters.php).
test again ldap authentication without password and report log here.

Thanks.


 
Posted : 23 Jan 2014 21H26
(@002514)
Posts: 68
Active Member
Topic starter
 

I followed your recommandation and this is the result of my test

2014-01-23 20:52:44 ----- DEBUG ----- ** trace binding admin **
2014-01-23 20:52:44 ----- DEBUG -----  user='CN=_ReadOnly Active Directory,CN=Users,DC=cb,DC=societe,DC=fr'
2014-01-23 20:52:44 ----- DEBUG -----  password='****'
2014-01-23 20:52:44 ----- DEBUG -----  binding OK
2014-01-23 20:52:44 ----- DEBUG ----- result:
2014-01-23 20:52:44 ----- DEBUG ----- 1
2014-01-23 20:52:44 ----- DEBUG ----- filter=sAMAccountName=YCARRE
2014-01-23 20:52:44 ----- DEBUG ----- dn=CN=Firstname Lastname,OU=USERS,OU=CBR-SCE-INFORMATIQUE,DC=cb,DC=canon,DC=fr
2014-01-23 20:52:44 ----- DEBUG ----- ldap_user_dn='CN=Firsname Lastname,OU=USERS,OU=CBR-SCE-INFORMATIQUE,DC=cb,DC=societe,DC=fr'
2014-01-23 20:52:44 ----- DEBUG ----- parampassword=''
2014-01-23 20:52:44 ----- DEBUG ----- result bind user:
2014-01-23 20:52:44 ----- DEBUG ----- 1
2014-01-23 20:52:44 ----- DEBUG ----- ** end trace binding *****

In this result, i can remark that the parampassword is empty

Thanks

Yannick


 
Posted : 23 Jan 2014 23H01
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Your filter "filter=sAMAccountName=YCARRE" retrived a user with dn="CN=Firstname Lastname,OU=USERS,OU=CBR-SCE-INFORMATIQUE,DC=cb,DC=canon,DC=fr" and it seems this this last one allows binding with no password.
Please check your filter to verify it returns the good ldap user.


 
Posted : 24 Jan 2014 1H45
(@002514)
Posts: 68
Active Member
Topic starter
 

I confirm that the user returned is the good ldap user

thanks


 
Posted : 24 Jan 2014 10H33
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

So it seems you can bind to this user without password.
Could you try it please.


 
Posted : 24 Jan 2014 15H28
(@002514)
Posts: 68
Active Member
Topic starter
 

I did a new test and i have always the same problem, i can connect to projeQtor Web site without put a password.
but i confirm that a password is required for this user in our Active Directory


 
Posted : 24 Jan 2014 18H44
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

could you try to mlog with a wrong passwrod ?
what happens ?


 
Posted : 24 Jan 2014 19H45
(@002514)
Posts: 68
Active Member
Topic starter
 

With a wrong password, impossible to connect me

This is the result with wrong password :
2014-01-24 19:00:32 ----- DEBUG ----- parampassword='fsdfd'
2014-01-24 19:00:32 ** ERROR ** ERROR **
2014-01-24 19:00:32
** ERROR ** on file 'E:wampwwwprojeqtormodelUser.php' at line (787)
2014-01-24 19:00:32
** ERROR ***** cause = ldap_bind(): Unable to bind to server: Invalid credentials
2014-01-24 19:00:32 ----- DEBUG ----- result bind user:
2014-01-24 19:00:32 ----- DEBUG -----
2014-01-24 19:00:32 ----- DEBUG ----- incorrect binding


 
Posted : 24 Jan 2014 21H03
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

So, could you try to replace line 801

			if (! $bind_user) {
			if (! $bind_user or !$parampassword) {

It seems that AD has strange response when connecting with no password.
This is a workaround.

If it works it will be integrated in version V4.2.


 
Posted : 24 Jan 2014 21H37
Page 1 / 2
Share:

Scroll to Top