org.apache.jetspeed.security.spi.impl.ldap
Class LdapUserCredentialDaoImpl

java.lang.Object
  extended by org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
      extended by org.apache.jetspeed.security.spi.impl.ldap.LdapUserCredentialDaoImpl
All Implemented Interfaces:
LdapReadOnlyPrincipalDao, LdapUserCredentialDao

public class LdapUserCredentialDaoImpl
extends AbstractLdapDao
implements LdapUserCredentialDao

Author:
Mike Long , David Le Strat
See Also:
LdapUserCredentialDao

Field Summary
 
Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
ctx
 
Constructor Summary
LdapUserCredentialDaoImpl()
           Default constructor.
LdapUserCredentialDaoImpl(LdapBindingConfig ldapConfig)
           Initializes the dao.
 
Method Summary
 boolean authenticate(java.lang.String uid, java.lang.String password)
           Looks up the user by the UID attribute.
 void changePassword(java.lang.String uid, java.lang.String password)
           Updates the password for the specified user.
protected  java.lang.String[] getAttributes()
           
protected  java.lang.String getEntryPrefix()
           A template method that returns the LDAP entry prefix of the concrete DAO.
protected  java.lang.String[] getObjectClasses()
           
 char[] getPassword(java.lang.String uid)
           
protected  java.lang.String getSearchDomain()
           The domain in wich to perform a search
protected  java.lang.String getSearchSuffix()
           A template method that returns the LDAP entry prefix of the concrete DAO.
 
Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
bindToServer, getGroupAttributes, getGroupFilter, getGroupFilterBase, getGroupIdAttribute, getGroupMembershipAttribute, getGroupMembershipForRoleAttribute, getGroupObjectClasses, getGroupObjectRequiredAttributeClasses, getGroupUidAttribute, getKnownAttributes, getRoleAttributes, getRoleFilter, getRoleFilterBase, getRoleGroupMembershipForRoleAttribute, getRoleIdAttribute, getRoleMembershipAttribute, getRoleObjectClasses, getRoleObjectRequiredAttributeClasses, getRoleUidAttribute, getRootContext, getSearchScope, getSubcontextName, getUidAttribute, getUserAttributes, getUserFilter, getUserFilterBase, getUserGroupMembershipAttribute, getUserIdAttribute, getUserObjectClasses, getUserPasswordAttribute, getUserRoleMembershipAttribute, getUserUidAttribute, lookupByUid, searchByWildcardedUid, searchGroupByWildcardedUid, searchRoleByWildcardedUid, setSearchControls, validateDn, validatePassword, validateUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.security.spi.impl.ldap.LdapReadOnlyPrincipalDao
lookupByUid
 

Constructor Detail

LdapUserCredentialDaoImpl

public LdapUserCredentialDaoImpl()
                          throws SecurityException

Default constructor.

Throws:
SecurityException - A SecurityException.

LdapUserCredentialDaoImpl

public LdapUserCredentialDaoImpl(LdapBindingConfig ldapConfig)
                          throws SecurityException

Initializes the dao.

Parameters:
ldapConfig - Holds the ldap binding configuration.
Throws:
SecurityException - A SecurityException.
Method Detail

changePassword

public void changePassword(java.lang.String uid,
                           java.lang.String password)
                    throws SecurityException

Updates the password for the specified user.

Specified by:
changePassword in interface LdapUserCredentialDao
Parameters:
uid - The uid.
password - The password.
Throws:
SecurityException - A SecurityException.

authenticate

public boolean authenticate(java.lang.String uid,
                            java.lang.String password)
                     throws SecurityException

Looks up the user by the UID attribute. If this lookup succeeds, this method then attempts to authenticate the user using the password, throwing an AuthenticationException if the password is incorrect or an OperationNotSupportedException if the password is empty.

Specified by:
authenticate in interface LdapUserCredentialDao
Parameters:
uid - The uid.
password - The password.
Throws:
SecurityException - Throws a SecurityException.

getPassword

public char[] getPassword(java.lang.String uid)
                   throws SecurityException
Specified by:
getPassword in interface LdapUserCredentialDao
Parameters:
uid - The uid.
Returns:
The password.
Throws:
SecurityException - A SecurityException.@throws SecurityException
See Also:
LdapUserCredentialDao.getPassword(java.lang.String)

getEntryPrefix

protected java.lang.String getEntryPrefix()
Description copied from class: AbstractLdapDao

A template method that returns the LDAP entry prefix of the concrete DAO.

TODO : this should be in spring config

Specified by:
getEntryPrefix in class AbstractLdapDao
Returns:
a String containing the LDAP entry prefix name.

getSearchSuffix

protected java.lang.String getSearchSuffix()
Description copied from class: AbstractLdapDao

A template method that returns the LDAP entry prefix of the concrete DAO.

TODO : this should be in spring config

Specified by:
getSearchSuffix in class AbstractLdapDao
Returns:
a String containing the LDAP entry prefix name.

getSearchDomain

protected java.lang.String getSearchDomain()
Description copied from class: AbstractLdapDao

The domain in wich to perform a search

TODO : this should be in spring config

Specified by:
getSearchDomain in class AbstractLdapDao
Returns:
a String containing the LDAP entry prefix name.

getObjectClasses

protected java.lang.String[] getObjectClasses()
Specified by:
getObjectClasses in class AbstractLdapDao

getAttributes

protected java.lang.String[] getAttributes()
Specified by:
getAttributes in class AbstractLdapDao


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.