LDAP

JVM since1.1.0 Native since3.2.0

Perform searches on LDAP servers.

What’s inside

Please refer to the above link for usage and configuration details.

Maven coordinates

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-ldap</artifactId>
</dependency>

Check the User guide for more information about writing Camel Quarkus applications.

Usage

Configuration via properties

The LDAP component supports property-based configuration in addition to plain Camel configuration. Configuration property should follow the pattern:

quarkus.camel.ldap.dir-contexts.<dirContextName>.<property>

For more details, refer to the dirContext Javadoc. The following options are available:

  • initial-context-factory

  • provider-url

  • security-authentication

  • security-protocol

  • socket-factory

If you need to specify an option that is not listed above, use the following property format:

quarkus.camel.ldap.dr-contexts."your_name".additional-options."not-listed_option_name"

Here is an example of configuration of a dirContext named your_context using SSL.

quarkus.camel.ldap.dir-contexts."your_context".initial-context-factory=com.sun.jndi.ldap.LdapCtxFactory
quarkus.camel.ldap.dir-contexts."your_context".provider-url=ldaps://${ldap.host}:${ldap.sslPort}
quarkus.camel.ldap.dir-contexts."your_context".security-protocol=ssl
quarkus.camel.ldap.dir-contexts."your_context".socket-factory=org.apache.camel.quarkus.component.ldap.it.CustomSSLSocketFactory

Using SSL in Native Mode

When using a custom SSLSocketFactory in native mode, such as the one in the Configuring SSL section, you need to register the class for reflection otherwise the class will not be made available on the classpath. Add the @RegisterForReflection annotation above the class definition, as follows:

@RegisterForReflection
public class CustomSSLSocketFactory extends SSLSocketFactory {
    // The class definition is the same as in the above link.
}

Additional Camel Quarkus configuration

Configuration property Type Default

The initial context factory to use. The value of the property should be the fully qualified class name of the factory class that will create an initial context.

string

The service provider to use. The value of the property should contain a URL string (e.g. "ldap://somehost:389").

string

The security protocol to use. Its value is a string determined by the service provider (e.g. "ssl").

string

The security level to use. Its value is one of the following strings: "none", "simple", "strong". If this property is unspecified, the behaviour is determined by the service provider.

string

none

The custom socket factory to use. The value of the property should be the fully qualified class name of the socket factory class.

string

Any other option which will be used during dirContext creation.

Map<String,String>

Configuration property fixed at build time. All other configuration properties are overridable at runtime.