|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao org.apache.jetspeed.security.spi.impl.ldap.LdapUserCredentialDaoImpl
public class LdapUserCredentialDaoImpl
LdapUserCredentialDao
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
logger
The logger. |
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(String uid,
String password)
Looks up the user by the UID attribute. |
void |
changePassword(String uid,
String password)
Updates the password for the specified user. |
private char[] |
convertRawPassword(Attribute attr)
This method converts an ascii password to a char array. |
private Attribute |
getAttribute(String attributeName,
Attributes userAttributes)
Get the attribute. |
protected String[] |
getAttributes()
|
protected String |
getEntryPrefix()
A template method that returns the LDAP entry prefix of the concrete DAO. |
private Attributes |
getFirstUser(NamingEnumeration results)
Gets the first matching user. |
protected String[] |
getObjectClasses()
|
private char[] |
getPassword(NamingEnumeration results,
String uid)
Get the password. |
char[] |
getPassword(String uid)
|
protected String |
getSearchDomain()
The domain in wich to perform a search |
protected String |
getSearchSuffix()
A template method that returns the LDAP entry prefix of the concrete DAO. |
private void |
setPassword(String userDn,
String password)
Set the user's password. |
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 |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public LdapUserCredentialDaoImpl() throws org.apache.jetspeed.security.SecurityException
Default constructor.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.public LdapUserCredentialDaoImpl(LdapBindingConfig ldapConfig) throws org.apache.jetspeed.security.SecurityException
Initializes the dao.
ldapConfig
- Holds the ldap binding configuration.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.Method Detail |
---|
public void changePassword(String uid, String password) throws org.apache.jetspeed.security.SecurityException
Updates the password for the specified user.
changePassword
in interface LdapUserCredentialDao
uid
- The uid.password
- The password.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.public boolean authenticate(String uid, String password) throws org.apache.jetspeed.security.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.
authenticate
in interface LdapUserCredentialDao
uid
- The uid.password
- The password.
org.apache.jetspeed.security.SecurityException
- Throws a SecurityException
.public char[] getPassword(String uid) throws org.apache.jetspeed.security.SecurityException
getPassword
in interface LdapUserCredentialDao
uid
- The uid.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.@throws SecurityExceptionLdapUserCredentialDao.getPassword(java.lang.String)
private void setPassword(String userDn, String password) throws NamingException
Set the user's password.
userDn
- The user.password
- The password.
NamingException
- Throws a NamingException
.private char[] getPassword(NamingEnumeration results, String uid) throws NamingException
Get the password.
results
- The NamingEnumeration
.uid
- The uid.
NamingException
- Throws a NamingException
.private Attribute getAttribute(String attributeName, Attributes userAttributes) throws NamingException
Get the attribute.
attributeName
- The attribute name.userAttributes
- The user Attributes
.
Attribute
NamingException
- Throws a NamingException
.private char[] convertRawPassword(Attribute attr) throws NamingException
This method converts an ascii password to a char array. It needs to be improved to do proper unicode conversion.
attr
- The Attribute
.
NamingException
private Attributes getFirstUser(NamingEnumeration results) throws NamingException
Gets the first matching user.
results
- The results to find the user in.
NamingException
- Throws a NamingException
.protected String getEntryPrefix()
AbstractLdapDao
A template method that returns the LDAP entry prefix of the concrete DAO.
TODO : this should be in spring config
getEntryPrefix
in class AbstractLdapDao
protected String getSearchSuffix()
AbstractLdapDao
A template method that returns the LDAP entry prefix of the concrete DAO.
TODO : this should be in spring config
getSearchSuffix
in class AbstractLdapDao
protected String getSearchDomain()
AbstractLdapDao
The domain in wich to perform a search
TODO : this should be in spring config
getSearchDomain
in class AbstractLdapDao
protected String[] getObjectClasses()
getObjectClasses
in class AbstractLdapDao
protected String[] getAttributes()
getAttributes
in class AbstractLdapDao
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |