com.atlassian.crowd.integration.directory.delegated
Class DelegatedAuthenticationDirectory

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.internal.InternalDirectory
      extended by com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory
All Implemented Interfaces:
BatchingRemoteDirectory, RemoteDirectory, AttributeAware

public class DelegatedAuthenticationDirectory
extends InternalDirectory

This implementation of a RemoteDirectory provides delegated authentication to an underlying remote LDAP implementation.

In essence this means that a User's groups and roles are managed internally to Crowd, but all actions regarding authentication are delegated to the remote directory.


Field Summary
static String DELEGATED_DIRECTORY_TYPE
           
 
Fields inherited from class com.atlassian.crowd.integration.directory.internal.InternalDirectory
ATTRIBUTE_PASSWORD_HISTORY_COUNT, ATTRIBUTE_PASSWORD_MAX_ATTEMPTS, ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME, ATTRIBUTE_PASSWORD_REGEX, ATTRIBUTE_USER_ENCRYPTION_METHOD, attributes, DESCRIPTIVE_NAME, groupDAO, i18nHelper, logger, membershipDAO, passwordEncoderFactory, passwordHelper, userDAO
 
Constructor Summary
DelegatedAuthenticationDirectory()
           
 
Method Summary
 User authenticate(String name, PasswordCredential credential)
          Authenticates a user with the directory store.
protected  void encryptCredentials(List credentials)
           
protected  RemoteDirectory getDelegatedDirectory()
           
 String getDescriptiveName()
          Returns a descriptive name for the type of directory.
protected  PasswordEncoder getEncoder()
           
 void setDirectoryDAO(DirectoryDAO directoryDAO)
           
 void setDirectoryInstanceLoader(DirectoryInstanceLoader directoryInstanceLoader)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void testConnection()
          Does nothing, connection is determined by the ability to communicate with the database.
 List<String> testUserSearch()
          Tests a blank principal search against the underlying LDAP directory.
 void updateUserCredential(String userName, PasswordCredential credential)
          Updates the password for a user.
protected  void validateRegex(PasswordCredential credential)
           
 
Methods inherited from class com.atlassian.crowd.integration.directory.internal.InternalDirectory
addAllGroups, addAllUsers, addAllUsersToGroup, addGroup, addGroupToGroup, addUser, addUserToGroup, currentPrincipalInvalidPasswordAttempts, findGroupByName, findGroupsByNames, findGroupWithAttributesByName, findUserByName, findUsersByNames, findUserWithAttributesByName, getAttribute, getAttributeNames, getAttributes, getDirectoryId, hasAttribute, isGroupDirectGroupMember, isUserDirectGroupMember, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, requiresPasswordChange, searchGroupRelationships, searchGroups, searchUsers, setAttributes, setDirectoryId, setGroupDAO, setI18nHelper, setMembershipDAO, setPasswordEncoderFactory, setPasswordHelper, setUserDAO, storeGroupAttributes, storeUserAttributes, supportsNestedGroups, updateGroup, updateUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELEGATED_DIRECTORY_TYPE

public static final String DELEGATED_DIRECTORY_TYPE
See Also:
Constant Field Values
Constructor Detail

DelegatedAuthenticationDirectory

public DelegatedAuthenticationDirectory()
Method Detail

authenticate

public User authenticate(String name,
                         PasswordCredential credential)
                  throws ObjectNotFoundException,
                         InactiveAccountException,
                         InvalidAuthenticationException
Description copied from interface: RemoteDirectory
Authenticates a user with the directory store.

Specified by:
authenticate in interface RemoteDirectory
Overrides:
authenticate in class InternalDirectory
Parameters:
name - The name of the user (username).
credential - The supplied credentials (password).
Returns:
user entity.
Throws:
InvalidAuthenticationException - if the user was unable to be created in the InternalDirectory after successful authentication with LDAP (eg. the LDAP User is not a valid Internal User), this exception may be thrown.
ObjectNotFoundException - The user wth the supplied name does not exist.
InactiveAccountException - The supplied user is inactive.

getEncoder

protected PasswordEncoder getEncoder()
Overrides:
getEncoder in class InternalDirectory

updateUserCredential

public void updateUserCredential(String userName,
                                 PasswordCredential credential)
                          throws ObjectNotFoundException,
                                 InvalidCredentialException
Description copied from interface: RemoteDirectory
Updates the password for a user.

Specified by:
updateUserCredential in interface RemoteDirectory
Overrides:
updateUserCredential in class InternalDirectory
Parameters:
userName - The name of the user (username).
credential - The new credential (password).
Throws:
ObjectNotFoundException - The user does not exist.
InvalidCredentialException - The supplied credential is invalid.

testConnection

public void testConnection()
                    throws DirectoryAccessException
Description copied from class: InternalDirectory
Does nothing, connection is determined by the ability to communicate with the database. Crowd wouldn't have started if the database connection failed.

Specified by:
testConnection in interface RemoteDirectory
Overrides:
testConnection in class InternalDirectory
Throws:
DirectoryAccessException - An unknown wire exception occurred.

encryptCredentials

protected void encryptCredentials(List credentials)

validateRegex

protected void validateRegex(PasswordCredential credential)
                      throws InvalidCredentialException
Throws:
InvalidCredentialException

getDelegatedDirectory

protected RemoteDirectory getDelegatedDirectory()
                                         throws DirectoryInstantiationException
Throws:
DirectoryInstantiationException

testUserSearch

public List<String> testUserSearch()
                            throws DirectoryInstantiationException
Tests a blank principal search against the underlying LDAP directory.

Returns:
User names as String's
Throws:
DirectoryInstantiationException - directory could not be loaded.

getDescriptiveName

public String getDescriptiveName()
Description copied from interface: RemoteDirectory
Returns a descriptive name for the type of directory.

Specified by:
getDescriptiveName in interface RemoteDirectory
Overrides:
getDescriptiveName in class InternalDirectory
Returns:
descriptive name.

setDirectoryInstanceLoader

public void setDirectoryInstanceLoader(DirectoryInstanceLoader directoryInstanceLoader)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)

setDirectoryDAO

public void setDirectoryDAO(DirectoryDAO directoryDAO)
Overrides:
setDirectoryDAO in class InternalDirectory


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.