can I create two ldap LoginHandler ?

Author Message

akiuni sanka

Thursday 20 May 2010 12:05:19 am

Hello

I need to authentify my users from 2 different Active Directory domains (=> 2 LDAP servers with different configuration inside). Does somebody has already done this ? If not, how can I do that ? I haven't found any post...

I was wondering if I could copy the ldap.ini to ldap2.ini, and then create a ldap2.ini.append.php where I configure the second domain configuration. Lastly, I could add a loginHandler in the site.ini.append.php. This would become :

[UserSettings]
LoginHandler[]
LoginHandler[]=LDAP
LoginHandler[]=LDAP2

Can you tell me if this could work ? if not, have you an idea on how to build my 2 domains authentication ?

thanks in advance....

akiuni

Bertrand Dunogier

Thursday 20 May 2010 1:23:59 am

Well, technically, you can chain multiple login handlers. This is what is usually done with LDAP, actually: first standard, so that the local user can be tried first, then LDAP as a fallback.

So if you have 2 different LDAP login handlers, the second one will be used if the first one fails, as simple as that.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

akiuni sanka

Thursday 20 May 2010 4:14:21 am

thanks for your answer Bertrand, do you think that the "ldap2" trick will work ?

I just fear that ezpublish won't accept it...

akiuni sanka

Thursday 20 May 2010 4:32:28 am

ok, I had a look to the sources files and I think that I have found my answer. The "ldap.ini" file is hardcoded in the following file :

./kernel/classes/datatypes/ezuser/ezldapuser.php :

$LDAPIni = eZINI::instance( 'ldap.ini' );

so I guess that ezpublish won't accept my ldap2 without creating a new type of users... ezldap2user for exemple.

thanks

akiuni

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:25:56
Script start
Timing: Jan 31 2025 01:25:56
Module start 'layout'
Timing: Jan 31 2025 01:25:56
Module start 'content'
Timing: Jan 31 2025 01:25:56
Module end 'content'
Timing: Jan 31 2025 01:25:56
Script end

Main resources:

Total runtime0.0206 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.2578151.2266
Module start 'layout' 0.00430.0036 739.4844220.7188
Module start 'content' 0.00790.0114 960.2031997.8359
Module end 'content' 0.01930.0013 1,958.039133.9922
Script end 0.0206  1,992.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.6588140.0002
Check MTime0.00104.8380140.0001
Mysql Total
Database connection0.00052.421310.0005
Mysqli_queries0.002110.344630.0007
Looping result0.00000.053210.0000
Template Total0.00094.210.0009
Template load0.00073.342210.0007
Template processing0.00020.878110.0002
Override
Cache load0.00052.304510.0005
General
dbfile0.00031.248380.0000
String conversion0.00000.033540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs