Crowd 2.0 : Creating a Custom Directory Connector
This page last changed on Oct 04, 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 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:
Next StepsAfter creating your directory connector, please see Configuring a Custom Directory Connector. Related Topics
|
![]() |
Document generated by Confluence on Jul 30, 2009 01:30 |