Custom Credential Checking - LDAP

The Enterprise version of KonaKart contains an LDAP module which can be configured through the Admin App. As can be seen from the image below, once installed, the module may be enabled / disabled by setting the status to true or false.

The LDAP username, password and URL are used to connect to the LDAP directory. The defaults shown above are those for Apache Directory. The Person Object DN is the distinguished name for accessing a person object within the LDAP directory. The default value of "ou=people,dc=example,dc=com" is valid for the example LDIF file which can be found in the KonaKart/custom/modules/src/com/konakartadmin/modules/others/ldap file system directory after installing KonaKart. This file contains a couple of entries (people) which match the default Person Object DN and can be used to test the LDAP module. For production use, the Person Object DN will need to be changed to match the tree structure of your LDAP directory.

The source of the code that connects to LDAP and verifies the customer's credentials can be found in the file KonaKart/custom/appnEE/src/com/konakart/bl/LDAPMgrCore.java in the method:

public int checkCredentials(String emailAddr, String password) throws Exception

This code may be modified and compiled in order to apply specific logic for the structure of your LDAP directory. The code has many comments and debug statements in order to be self-explanatory. As in the case of the LoginIntegrationMgr the checkCredentials() method can return the following values:

The Admin App allows you to define a class name for the LDAP object that gets instantiated for both the application engine and the admin engine whenever a person attempts to log in. The default class for the application engine is com.konakart.bl.LDAPMgr and can be found in the KonaKart/custom/appnEE/src/com/konakart/bl directory. The class for the admin engine is com.konakartadmin.bl.AdminLDAPMgr and can be found in the KonaKart/custom/adminappnEE/src/com/konakartadmin/bl directory . They both implement interfaces and so can be substituted with other classes that implement the same interfaces. These classes only contain a small amount of code that reads the configuration variables to set up the LDAP module, The code that actually makes the connection (and validates the credentials) can be found in KonaKart/custom/appnEE/src/com/konakart/bl/LDAPMgrCore.java and is common to both the application and admin engines.