Forums / Install & configuration / Win2k LDAP Server Authentication

Win2k LDAP Server Authentication

Author Message

Ashley Knowles

Monday 26 September 2005 11:36:13 pm

Okay I am running a multidomain Active Directory tree here, and users must therefore logon to the LDAP server in the form <username>@<domain name>.

The problem being with this is that the SAM Account Name is not equal to <username>@<domain name>.

I have tried modifying the source code, in the files mentioned in the AD 2003 Hack, but still cannot manage to get it right.

If anyone could let me know how the config file should be setup to work with Active Directory then that would be great. In particular the group related fields as I cannot seem to find any information on what these actually do or what they should reference.

Ashley Knowles

Tuesday 27 September 2005 11:20:50 pm

Further to this, AD stores usernames in the LDAP field "samaccountname". As people logon using username@domain, when ez publish queries the LDAP server, it cannot find username@domain, because samaccountname only holds the username part.

Ashley Knowles

Tuesday 04 October 2005 8:08:04 pm

*bump*

Anybody at all got an idea?

Gunnstein Lye

Friday 14 October 2005 1:56:46 am

Did you find out anything? If not, I'll try to answer this soon.

(I'll wait for your reply.)

best regards

Ashley Knowles

Monday 07 November 2005 6:35:31 pm

Absolutely nothing....

Gunnstein Lye

Tuesday 08 November 2005 1:19:51 am

Allright then, I'll give it a shot. Disclaimer: I know nothing about Active Directory.

First: If your LDAP server does not allow anonymous bind, then you need the support for authenticated bind which will be in 3.8. You can get it in the svn.

Second, the LDAP version number must be correct, either 2 or 3 at the moment. I don't know what is correct for Active Directory, but its documentation should specify it.

Skip the search filters, at least to begin with.

The login attribute refers to the attribute in your LDAP login which should be used as the users' login.

eZ publish needs to store the ldap users as local eZ publish users, in order to use them. More about this in the next 4 paragraphs:

The LDAPUserGroupType and LDAPUserGroup are related. If the LDAPUserGroupType is id, then the LDAPUserGroup refers to content object ids of eZ publish user groups. If it is name, the LDAPUserGroup refers to names of eZ publish user groups.

If the LDAPUserGroup is an array, then the first one will be the default placement of ldap users. If it's not, then all ldap users are stored in the same eZ publish user group.

LDAPUserGroupAttributeType and LDAPUserGroupAttribute are used to specify which attribute of the ldap user object eZ publish should use when deciding where to place the users.

So, an example:
LDAPUserGroupType=name
LDAPUserGroup[]=Default
LDAPUserGroup[]=Secretary
LDAPUserGroup[]=Clerk
LDAPUserGroup[]=Boss
LDAPUserGroupAttributeType=name
LDAPUserGroupAttribute=employeetype
Now, when logging in, eZ publish looks at the LDAP object, and finds the attribute whose name is employeetype, and reads its value. Then, eZ publish searches for an eZ publish user group whose name equals the given value. If it is found, then the user is stored there. If not, it is stored in Default. That should cover the user group settings.

The first name, last name and email settings are used when storing the eZ publish copy of the user.

Now, to the SAM account name. You can either:
- Set LDAPLoginAttribute=samaccountname, and tell people to login with just username, instead of username@domainname, or:

- Find (or create) an LDAP attribute that contains the entire username@domainname, and set LDAPLoginAttribute to that, or, if that is not possible:

- Last solution: If you can not get the entire username@domainname as one single LDAP attribute, then you need to add support for using several attributes. You could set LDAPLoginAttribute=samaccountname@domain (given that the attribute "domain" contains the users domain), and then add the necessary code in kernel/classes/datatypes/ezuser/ezldapuser.php. The relevant part is around line 242 (in 3.8 svn): $LDAPFilter .= "($LDAPLogin=$login)";
Here you need to split $LDAPLogin and $login by "@", and change the filter a bit. Something like this, I think:
$LDAPFilter .= "($LDAPLoginPart1=$loginPart1)";
$LDAPFilter .= "($LDAPLoginPart2=$loginPart2)";

This is very experimental and hypothetical, of course. I hope you don't need to resort to this. If you do, we should add this feature to the distribution.

I hope this helps!

eZ debug

Timing: Jan 31 2025 01:25:11
Script start
Timing: Jan 31 2025 01:25:11
Module start 'content'
Timing: Jan 31 2025 01:25:12
Module end 'content'
Timing: Jan 31 2025 01:25:12
Script end

Main resources:

Total runtime0.2004 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.0547370.2813
Module start 'content' 0.00670.0130 958.33591,009.5781
Module end 'content' 0.01980.1805 1,967.91413,897.9922
Script end 0.2003  5,865.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00472.3272200.0002
Check MTime0.00140.7172200.0001
Mysql Total
Database connection0.00070.354810.0007
Mysqli_queries0.103551.63501410.0007
Looping result0.00170.83881390.0000
Template Total0.180089.910.1800
Template load0.00080.386710.0008
Template processing0.179389.469410.1793
Override
Cache load0.00050.251410.0005
Sytem overhead
Fetch class attribute can translate value0.00201.014710.0020
XML
Image XML parsing0.00030.131310.0003
General
dbfile0.00401.9949200.0002
String conversion0.00000.002430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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