LDAP Hack is a simple implementation of an authorization mechanism for ldap. It can provide LDAP Authentication to applications which do not natively support LDAP authentication. The intention of this class is to be used in hacking LDAP authentication into a third-party software application. See the javadoc API for a hacking example.

LDAP Hack is Open Source and Free to use. See the LICENSE .


The requirements for compiling ldaphack is as follows:

  • ldaphack-0.01.xxx
    • Java 1.5
      Required for XML property file. ldaphack is able to be compiled for Java 1.4 if it is modified to implement the older property file style, which is not XML.


View the LDAP Hack Java doc api online.
View the LDAP Hack Subversion repository online.

You can download the source code from Subversion (Maven 2 project).

Integration of the LDAP Hack into other projects


The LDAP Hack has been integrated into SCARAB to allow for LDAP Authentication for SCARAB users.

The hack provided here will first attempt to find the user, who is attempting to log in, in LDAP based on a configuration and search filter you supply in a property file. If the user is found in LDAP but the password is wrong, an error "Invalid Password" is given. If the user is not found in LDAP then the LDAP Hack passes the authentication on to the normal scarab authentication process.

To integrate you will need to:

  1. download and compile the ldaphack class. (Alternately, see integrated hacks below for compiled jars)
  2. add your compiled LDAP Hack jar to the SCARAB library repository
  3. add the ldaphack.ldapauth.properties file to SCARAB classpath
  4. modify the Login class (Login.java) to integrate the LDAP Hack code. See the diff of Login.java.
  5. and build the SCARAB web application. Refer to SCARAB or SCARAB's bundled INSTALL file for instructions on how to compile the SCARAB web application.
  6. Change the property scarab.login.password.expire in the Scarab.properties file to be blank, so that the password stored in Scarab's database never expires. LDAP will manage your passwords.

Alternately, you can check out the full modified code for scarab from subversion (includes compiled ldaphack jar). Currently available hacked versions: