This page last changed on May 05, 2008 by smaddox.

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 page 2.2.3 Configuring a Custom Directory Connector does not exist.

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:

  1. Create a JAR of the MyCustomDirectoryServer and any supporting class files.
  2. Shut down Crowd.
  3. Place the newly-created JAR from step one in the CROWD/crowd-webapp/WEB-INF/lib folder.
  4. Start Crowd.
  5. Follow the instructions on configuring a custom directory connector through the Crowd Administration Console.
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'.

Next Steps

After creating your directory connector, please see Configuring a Custom Directory Connector.

Related Topics

Crowd Documentation

Document generated by Confluence on May 08, 2008 19:37