The ldap component allows you to perform searches in LDAP servers using filters as the message payload.
Maven users will need to add the following dependency to their
The ldapServerBean portion of the URI refers to a DirContext bean in the registry. The LDAP component only supports producer endpoints, which means that an
You can append query options to the URI in the following format,
The result is returned in the Out body as a
The preceding example declares a regular Sun based LDAP
Following on from the Spring configuration above, the code sample below sends an LDAP request to filter search a group for a member. The Common Name is then extracted from the response.
If no specific filter is required - for example, you just need to look up a single entry - specify a wildcard filter expression. For example, if the LDAP entry has a Common Name, use a filter expression like:
Binding using credentials
A Camel end user donated this sample code he used to bind to the ldap server using credentials.
All required is to create a custom socket factory and reference it in the InitialDirContext bean - see below sample.