com.konakartadmin.blif
Interface AdminLDAPMgrIf
- All Known Implementing Classes:
- AdminLDAPMgr
public interface AdminLDAPMgrIf
The interface that must be implemented by an LDAP Manager
Method Summary |
int |
checkCredentials(java.lang.String emailAddr,
java.lang.String password)
Called if the LDAP module is installed and active. |
checkCredentials
int checkCredentials(java.lang.String emailAddr,
java.lang.String password)
throws KKAdminException
- Called if the LDAP module is installed and active. This method should return:
- A negative number in order for the login attempt to fail. The KonaKart login() method
will return a null sessionId
- Zero to signal that this method is not implemented. The KonaKart login() method will
perform the credential check.
- A positive number for the login attempt to pass. The KonaKart login() will not check
credentials, and will log in the customer, returning a valid session id.
This method may need to be modified slightly depending on the structure of your LDAP. The
example works when importing the exampleData.ldif file in the LDAP module jar:
dn: cn=Robert Smith,ou=people,dc=example,dc=com
objectclass: inetOrgPerson
cn: Robert Smith
cn: Robert J Smith
cn: bob smith
sn: smith
uid: rjsmith
userpassword: rJsmitH
carlicense: HISCAR 123
homephone: 555-111-2222
mail: [email protected]
mail: [email protected]
mail: [email protected]
description: swell guy
The code attempts to connect to LDAP using the username, password and URL in the
configuration variables set when the module was installed through the admin app.
After having connected, the person object is searched for using the email address of the
user. If found we use the "cn" attribute and the password of the user to attempt to bind to
LDAP. If the bind is successful, we return a positive number which means that authentication
was successful.
- Parameters:
emailAddr
- The user name required to log inpassword
- The log in password
- Returns:
- Returns an integer
- Throws:
KKAdminException
Copyright © 2011 DS Data Systems UK Ltd.