LDAP Integration

Oak comes with a default implementation of an LDAP identity provider that allows perform external authentication against an existing LDAP in combination with user synchronization.

See section External Login Module and User Synchronization for a general overview of the ExternalLoginModule and how it can be used in combination with custom identity providers and synchronization handlers.

Default Setup

Out of the box Oak comes with the following LDAP integration setup:

  • LdapIdentityProvider: LDAP specific implementation of the ExternalIdentityProvider interface.
  • DefaultSyncHandler: Default implementation of the SyncHandler interface.
  • ExternalLoginModule: Login module implementation that allows for third party authentication as specified by the configured identity provider(s).

Characteristics of the Default Implementation

LDAP Identity Provider

The LdapIdentityProvider is a service implementing the ExternalIdentityProvider interface. Since Oak 1.6.1 it also implements the PrincipalNameResolver interface to allow for fast resolution from a given ExternalIdentityRef to a principal name as an optimization for the dynamic membership feature.

In an OSGi-base setup the configuration options required in order to establish connections to the LDAP are obtained form the properties associated with the service.

Otherwise the identity provider must be instantiated with the corresponding LdapProviderConfig object revealing the mandatory config options. The details of the LDAP configuration are listed below in section Configuration.

Combining Multiple LDAP Sources

Currently the only way to combine multiple LDAP sources is to have multiple entries of the ExternalLoginModule configured in the JAAS setup each coming with it's own identity provider implementation and sync handler.

See OAK-1839 for an improvement request that allows to have multiple identity provider implementations configured with the ExternalLoginModule.

Configuration

Configure LDAP Integration

The following steps are required in order to configure LDAP integration with the Oak repository:

  • ensure ExternalLoginModule forms part of the systems JAAS Configuration
  • enable the LDAP IdentityProvider and make sure it's properly configured (see section LDAP Configuration below)

LDAP Configuration

The LDAP IPDs are configured through the org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapProviderConfig which is populated either via OSGi or during manual Repository Construction.

NamePropertyDescription
LDAP Provider Nameprovider.nameName of this LDAP provider configuration. This is used to reference this provider by the login modules.
Bind DNbind.dnDN of the user for authentication. Leave empty for anonymous bind.
Bind Passwordbind.passwordPassword of the user for authentication.
LDAP Server Hostnamehost.nameHostname of the LDAP server
Disable certificate checkinghost.noCertCheckIndicates if server certificate validation should be disabled.
LDAP Server Porthost.portPort of the LDAP server
Use SSLhost.sslIndicates if an SSL (LDAPs) connection should be used.
Use TLShost.tlsIndicates if TLS should be started on connections.
Search TimeoutsearchTimeoutTime in until a search times out (eg: ‘1s’ or ‘1m 30s’).
Admin pool max activeadminPool.maxActiveThe max active size of the admin connection pool. When non-positive, there is no limit to the number of objects that can be managed by the pool at one time. A value of 0 disables this pool.
Admin pool lookup on validateadminPool.lookupOnValidateIndicates an ROOT DSE lookup is performed to test if the connection is still valid when taking it out of the admin pool.
User pool max activeuserPool.maxActiveThe max active size of the user connection pool. When non-positive, there is no limit to the number of objects that can be managed by the pool at one time. A value of 0 disables this pool.
User pool lookup on validateuserPool.lookupOnValidateIndicates an ROOT DSE lookup is performed to test if the connection is still valid when taking it out of the user pool.
User base DNuser.baseDNThe base DN for user searches.
User extra filteruser.extraFilterExtra LDAP filter to use when searching for users. The final filter is formatted like: (&(<idAttr>=<userId>)(objectclass=<objectclass>)<extraFilter>)
User id attributeuser.idAttributeName of the attribute that contains the user id.
User DN pathsuser.makeDnPathControls if the DN should be used for calculating a portion of the intermediate path.
User object classesuser.objectclassThe list of object classes an user entry must contain.
Group base DNgroup.baseDNThe base DN for group searches.
Group extra filtergroup.extraFilterExtra LDAP filter to use when searching for groups. The final filter is formatted like: (&(<nameAttr>=<groupName>)(objectclass=<objectclass>)<extraFilter>)
Group DN pathsgroup.makeDnPathControls if the DN should be used for calculating a portion of the intermediate path.
Group member attributegroup.memberAttributeGroup attribute that contains the member(s) of a group.
Group name attributegroup.nameAttributeName of the attribute that contains the group name.
Group object classesgroup.objectclassThe list of object classes a group entry must contain.
Use user id for external idsuseUidForExtIdIf enabled, the value of the user id (resp. group name) attribute will be used to create external identifiers. Leave disabled to use the DN instead.
Custom AttributescustomattributesAttributes retrieved when looking up LDAP entries. Leave empty to retrieve all attributes.

SyncHandler and External Login Module

See External Login Module and User Synchronization for details about the external login module and configuration options for the DefaultSyncHandler.