Last updated Mar 27, 2024

Custom user directories in Confluence

Atlassian does not support code-level customisations of our products. We will support your instance for problems other than user-management-related issues if you are using custom user management code.

This documentation applies to Confluence 3.5 and later.

Introduction

Writing a custom user directory should be the last resort of customers who cannot use any of our supported user management configurations, and cannot use the database or remote API to manually synchronise their users with Confluence.

These instructions are written for customers who are able to write and debug Java code in a web application like Confluence. If you do not have experience doing this, custom user directories are probably not the best approach for your situation.

Writing a custom user directory

To use a custom user directory in Confluence, you need to write a custom subclass of com.atlassian.crowd.directory.RemoteDirectory. You may wish to subclass one of the existing implementations in Crowd: MicrosoftActiveDirectory.

If you extend an existing implementation, an instance of your directory will be wrapped in a database-caching layer (DbCachingRemoteDirectory) like the default implementations are. If you don't extend an existing implementation, you will not get any caching. This should be considered when evaluating the performance of your custom user directory.

Installing a custom user directory

To use a custom directory, you need to configure a directory in Confluence through the UI of the appropriate type, then modify the database to set the implementation class to the type you've created.

  1. Install the compiled custom user directory in Confluence's classpath - either as a JAR in confluence/WEB-INF/lib/ or as a class file in the appropriate directory under confluence/WEB-INF/classes/
  2. Using the Confluence web UI, set up one of the built-in directory types with the configuration options you need.
  3. Update the database to set 'impl_class' (and 'lower_impl_class') in the cwd_directory table in the database to the fully qualified name (and lowercase fully-qualified name) of your RemoteDirectory implementation class.
  4. Add any additional attributes required by your implementation to cwd_directory_attribute table.

Note: code customisations are not supported by Atlassian. If you need help with implementing this, you can try the forums.

Rate this page: