|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao
org.apache.jetspeed.security.spi.impl.ldap.LdapUserCredentialDaoImpl
LdapUserCredentialDao
Field Summary | |
private static org.apache.commons.logging.Log |
LOG
The logger. |
private static String |
PASSWORD_ATTR_NAME
The password attribute. |
Fields inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao |
ctx, defaultDnSuffix, rootContext, rootDn, rootPassword |
Constructor Summary | |
LdapUserCredentialDaoImpl()
Default constructor. |
|
LdapUserCredentialDaoImpl(String ldapServerName,
String rootDn,
String rootPassword,
String rootContext,
String defaultDnSuffix)
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. |
private Attributes |
getFirstUser(NamingEnumeration results)
Gets the first matching user. |
protected String |
getObjectClass()
A template method that returns the LDAP object class of the concrete DAO. |
private char[] |
getPassword(NamingEnumeration results,
String uid)
Get the password. |
char[] |
getPassword(String uid)
|
private void |
setPassword(String userDn,
String password)
Set the user's password. |
Methods inherited from class org.apache.jetspeed.security.spi.impl.ldap.AbstractLdapDao |
bindToServer, getSubcontextName, lookupByUid, searchByWildcardedUid, 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 |
Field Detail |
private static final org.apache.commons.logging.Log LOG
private static final String PASSWORD_ATTR_NAME
Constructor Detail |
public LdapUserCredentialDaoImpl() throws NamingException, org.apache.jetspeed.security.SecurityException
Default constructor.
NamingException
- A NamingException
.
org.apache.jetspeed.security.SecurityException
- A SecurityException
.public LdapUserCredentialDaoImpl(String ldapServerName, String rootDn, String rootPassword, String rootContext, String defaultDnSuffix) throws NamingException, org.apache.jetspeed.security.SecurityException
Initializes the dao.
ldapServerName
- The server name.rootDn
- The root domain.rootPassword
- The root password.rootContext
- The root context.defaultDnSuffix
- The default suffix.
NamingException
- A NamingException
.
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 getObjectClass()
A template method that returns the LDAP object class of the concrete DAO.
getObjectClass
in class AbstractLdapDao
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |