
Documentation for Crowd 1.6. Documentation for other versions of Crowd is available too.
Crowd comes with a number of supplied directory connectors. If your directory is not listed in Supported Applications and Directories then you will need to create your own custom directory connector.
The directory connectors that come with Crowd implement the Java interface RemoteDirectory. The RemoteDirectory interface defines generic methods for authentication, searching and entity create, remove and update operations.
To connect Crowd to a custom directory server, you will need to write a Java class file that implements the RemoteDirectory interface.
In our example below, the MyCustomDirectoryServer class extends the Crowd DirectoryEntity utility class. The utility class manages setting runtime properties that may be used by the Crowd server in the future for operations such as getting the Crowd ID number of the directory server.
package com.atlassian.crowd.integration.directory.custom;
import com.atlassian.crowd.integration.SearchContext;
import com.atlassian.crowd.integration.authentication.PasswordCredential;
import com.atlassian.crowd.integration.directory.RemoteDirectory;
import com.atlassian.crowd.integration.exception.*;
import com.atlassian.crowd.integration.model.DirectoryEntity;
import com.atlassian.crowd.integration.model.RemoteGroup;
import com.atlassian.crowd.integration.model.RemotePrincipal;
import com.atlassian.crowd.integration.model.RemoteRole;
import java.rmi.RemoteException;
import java.util.List;
public class MyCustomDirectoryServer extends DirectoryEntity implements RemoteDirectory
{
public RemotePrincipal authenticate(String name, PasswordCredential[] credentials) throws RemoteException,
InvalidPrincipalException, InactiveAccountException, InvalidAuthenticationException {
// Perform your custom directory server authentication code here.
//
// The source code to the InternalDirectory, which comes with your commercial license is a good implementation example.
}
// Other RemoteDirectory interface methods will also need to be implemented ...
}
Once you have finished implementing all of the methods defined by the RemoteDirectory interface, you will then need to:
MyCustomDirectoryServer and any supporting class files.CROWD/crowd-webapp/WEB-INF/lib folder.Full Javadoc for the RemoteDirectory interface can be found here: http://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/integration/directory/RemoteDirectory.html.
A 'principal' is a 'user'
In Crowd, the term 'principal' is equivalent to the term 'user'. In Crowd 1.3.0 and later, the Crowd Administration Console uses the term 'user'. Earlier versions of Crowd, and also certain API libraries, use the term 'principal'.
After creating your directory connector, please see Configuring a Custom Directory Connector.