public class LDAPMgrCore
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
ldapPassword |
protected java.lang.String |
ldapUserName |
protected static org.apache.commons.logging.Log |
log
the log
|
protected java.lang.String |
personDN |
protected java.lang.String |
url |
Constructor and Description |
---|
LDAPMgrCore()
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
checkCredentials(java.lang.String emailAddr,
java.lang.String password)
Called if the LDAP module is installed and active.
|
java.lang.String |
getLdapPassword() |
java.lang.String |
getLdapUserName() |
java.lang.String |
getPersonDN() |
java.lang.String |
getUrl() |
void |
setLdapPassword(java.lang.String ldapPassword) |
void |
setLdapUserName(java.lang.String ldapUserName) |
void |
setPersonDN(java.lang.String personDN) |
void |
setUrl(java.lang.String url) |
protected static org.apache.commons.logging.Log log
protected java.lang.String ldapUserName
protected java.lang.String ldapPassword
protected java.lang.String url
protected java.lang.String personDN
public int checkCredentials(java.lang.String emailAddr, java.lang.String password) throws java.lang.Exception
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: r.smith@example.com
mail: rsmith@example.com
mail: bob.smith@example.com
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.
emailAddr
- The user name required to log inpassword
- The log in passwordjava.lang.Exception
- an unexpected exception unexpected exceptionpublic java.lang.String getLdapUserName()
public void setLdapUserName(java.lang.String ldapUserName)
ldapUserName
- the ldapUserName to setpublic java.lang.String getLdapPassword()
public void setLdapPassword(java.lang.String ldapPassword)
ldapPassword
- the ldapPassword to setpublic java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- the url to setpublic java.lang.String getPersonDN()
public void setPersonDN(java.lang.String personDN)
personDN
- the personDN to setCopyright © 2018 DS Data Systems UK Ltd.