LDAP Auth provider

This is an auth provider implementation that authenticates via LDAP.

Getting started

To use this project, add the following dependency to the dependencies section of your build descriptor:

  • Maven (in your pom.xml):

  • Gradle (in your build.gradle file):

compile 'io.vertx:vertx-auth-ldap:4.0.3'


To create an instance of the Ldap auth provider, use LdapAuthentication.create as follows:


The class LdapAuthenticationOptions is used to configure the Ldap authentication provider:


this query is used when looking up a user with a particular id. An example is uid={0},ou=users,dc=foo,dc=com - the element {0} is substituted with the user id to create the actual lookup. This setting is mandatory.


the url to the LDAP server. The url must start with ldap:// and a port must be specified. An example is ldap://myldapserver.mycompany.com:10389


Sets the type of LDAP authentication mechanism to use when connecting to the LDAP server.


Sets the LDAP referral behavior when creating a connection. Defaults to follow. See the Sun/Oracle LDAP referral documentation for more: http://java.sun.com/products/jndi/tutorial/ldap/referral/jndi.html


Note that when authenticating using this implementation, it assumes username and password fields are present in the authentication info