Alfresco with Zimbra LDAP

So, i’ve done with a working LDAP configuration to sync users and groups from Zimbra (see below), but one thing missing yet…

The Alfresco synchronizer service reads from LDAP and writes all users and all groups into repository, but does not reproduce nested group hierarchy.

Retrieve Zimbra LDAP root password:

zmlocalconfig -s zimbra_ldap_password

Let see the configuration in extension/subsystems/Authentication/ldap/ldap1/ldap-authentication.properties:

...

# The URL to connect to the LDAP server 
ldap.authentication.java.naming.provider.url=ldap://zimbra.XXX.hu:389

# The authentication mechanism to use for password validation
ldap.authentication.java.naming.security.authentication=simple

...

# This flag enables use of this LDAP subsystem for user and group
# synchronization. It may be that this subsytem should only be used for 
# authentication, in which case this flag should be set to false.
ldap.synchronization.active=true

# The authentication mechanism to use for synchronization
ldap.synchronization.java.naming.security.authentication=simple

# The default principal to use (only used for LDAP sync)
ldap.synchronization.java.naming.security.principal=uid\=zimbra,cn\=admins,cn\=zimbra

# The password for the default principal (only used for LDAP sync)
ldap.synchronization.java.naming.security.credentials=ZIMBRA_LDAP_PASSWORD

# The query to select all objects that represent the groups to import.
ldap.synchronization.groupQuery=(objectclass\=zimbraDistributionList)

# The query to select objects that represent the groups to import that have changed since a certain time.
ldap.synchronization.groupDifferentialQuery=(&(objectclass\=zimbraDistributionList)(!(modifyTimestamp< \={0})))


# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(objectClass\=organizationalPerson)

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(&(objectclass\=organizationalPerson)(!(modifyTimestamp<\={0})))


# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=ou\=people,dc\=XXX,dc\=hu

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=ou\=people,dc\=XXX,dc\=hu


# The name of the operational attribute recording the last update time for a group or user.
ldap.synchronization.modifyTimestampAttributeName=modifyTimestamp

# The timestamp format. Unfortunately, this varies between directory servers.
ldap.synchronization.timestampFormat=yyyyMMddHHmmss'Z'


# The attribute name on people objects found in LDAP to use as the uid in Alfresco
ldap.synchronization.userIdAttributeName=mail

# The attribute on person objects in LDAP to map to the first name property in Alfresco
ldap.synchronization.userFirstNameAttributeName=displayName

# The attribute on person objects in LDAP to map to the last name property in Alfresco
ldap.synchronization.userLastNameAttributeName=

# The attribute on person objects in LDAP to map to the email property in Alfresco
ldap.synchronization.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the organizational id  property in Alfresco
ldap.synchronization.userOrganizationalIdAttributeName=cn

# The default home folder provider to use for people created via LDAP import
ldap.synchronization.defaultHomeFolderProvider=userHomesHomeFolderProvider


# The attribute on LDAP group objects to map to the authority name property in Alfresco
ldap.synchronization.groupIdAttributeName=mail

# The attribute on LDAP group objects to map to the authority display name property in Alfresco (v3.3+)
ldap.synchronization.groupDisplayNameAttributeName=mail

# The group type in LDAP
ldap.synchronization.groupType=zimbraDistributionList

# The person type in LDAP
ldap.synchronization.personType=organizationalPerson

# The attribute in LDAP on group objects that defines the DN for its members
ldap.synchronization.groupMemberAttributeName=zimbraMailForwardingAddress

# If true progress estimation is enabled. When enabled, the user query has to be run twice in order to count entries.
ldap.synchronization.enableProgressEstimation=true

Hint: Zimbra and LDAP posts at wajatimur.wordpress.com blog

Enable LDAP server in OSX

A quick step-by-step tutorial (and reminder for me) to enable and configure built-in OpenLDAP server in Mac OS X Tiger, Leopard and Snow Leopard clients:

1. Generate a new LDAP password:

$ slappasswd        
New password: 
Re-enter new password: 
{SSHA}rqmauEi1zu+1YgMEUwihtiYzZtPr0+KO

2. Create a new LDAP configuration by default:

$ cd /etc/openldap
$ sudo cp slapd.conf.default slapd.conf

3. Edit LDAP configuration:

$ sudo mcedit slapd.conf

Example values:
suffix “dc=localhost,dc=com”
rootdn “cn=Manager,dc=localhost,dc=com”
rootpw {SSHA}rqmauEi1zu+1YgMEUwihtiYzZtPr0+KO

4. Start OpenLDAP server:

$ sudo /usr/libexec/slapd -d 255
@(#) $OpenLDAP: slapd 2.4.11 (Feb 11 2010 02:23:14) $
daemon_init: 
daemon: SLAP_SOCK_INIT: dtblsize=256
daemon_init: listen on ldap:///
daemon_init: 1 listeners to open...
...

5. Check LDAP port (389) to listen:

$ nmap localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2010-07-05 11:47 CEST
Interesting ports on localhost (127.0.0.1):
Not shown: 1706 closed ports
PORT      STATE SERVICE
22/tcp    open  ssh
80/tcp    open  http
88/tcp    open  kerberos-sec
389/tcp   open  ldap
...

Just use Eclipse based multiplatform Apache Directory Studio or native Cocoa application LDAP Manager to manage your LDAP server…