// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-ldap"]
= LDAP
:linkattrs:
:cq-artifact-id: camel-quarkus-ldap
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Perform searches on LDAP servers.
:cq-deprecated: false
:cq-jvm-since: 1.1.0
:cq-native-since: 3.2.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##3.2.0##
endif::[]

Perform searches on LDAP servers.

[id="extensions-ldap-whats-inside"]
== What's inside

* xref:{cq-camel-components}::ldap-component.adoc[LDAP component], URI syntax: `ldap:dirContextName`

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

[id="extensions-ldap-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-ldap[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-ldap</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-ldap-usage"]
== Usage
[id="extensions-ldap-usage-configuration-via-properties"]
=== Configuration via properties

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

[source,properties]
----
quarkus.camel.ldap.dir-contexts.<dirContextName>.<property>
----

For more details, refer to the dirContext https://docs.oracle.com/en/java/javase/17/docs/api/java.naming/javax/naming/directory/DirContext.html[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:

[source,properties]
----
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.

[source,properties]
----
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
----

[id="extensions-ldap-usage-using-ssl-in-native-mode"]
=== Using SSL in Native Mode

When using a custom `SSLSocketFactory` in native mode, such as the one in the xref:{cq-camel-components}::ldap-component.adoc#_configuring_ssl[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:

[source,java]
----
@RegisterForReflection
public class CustomSSLSocketFactory extends SSLSocketFactory {
    // The class definition is the same as in the above link. 
}
----


[id="extensions-ldap-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

[width="100%",cols="80,5,15",options="header"]
|===
| Configuration property | Type | Default


a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-initial-context-factory]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-initial-context-factory[quarkus.camel.ldap.dir-contexts."dir-contexts".initial-context-factory]`

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`
| 

a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-provider-url]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-provider-url[quarkus.camel.ldap.dir-contexts."dir-contexts".provider-url]`

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

a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-security-protocol]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-security-protocol[quarkus.camel.ldap.dir-contexts."dir-contexts".security-protocol]`

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

a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-security-authentication]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-security-authentication[quarkus.camel.ldap.dir-contexts."dir-contexts".security-authentication]`

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`

a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-socket-factory]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-socket-factory[quarkus.camel.ldap.dir-contexts."dir-contexts".socket-factory]`

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

a| [[quarkus-camel-ldap-dir-contexts-dir-contexts-additional-options-additional-options]]`link:#quarkus-camel-ldap-dir-contexts-dir-contexts-additional-options-additional-options[quarkus.camel.ldap.dir-contexts."dir-contexts".additional-options."additional-options"]`

Any other option which will be used during dirContext creation.
| `Map<String,String>`
| 
|===

[.configuration-legend]
{doc-link-icon-lock}[title=Fixed at build time] Configuration property fixed at build time. All other configuration properties are overridable at runtime.

