# Jive Messenger LDAP Guide

## Introduction

This document details how to configure your Jive Messenger installation to use an external LDAP store when authenticating users.

## Background

LDAP (Lightweight Directory Access Protocol) has emerged as a dominant standard for user authentication and for storage of user profile data. It serves as a powerful tool for large organizations (or those organizations integrating many applications) to simplify user management issues.

By default, Jive Messenger stores all user data in a database and performs authentication using database lookups. The LDAP module replaces that functionality and allows Jive Messenger to:

- Use a LDAP server to authenticate a user's identity.
- Load and store user profile information in a LDAP directory.

This document will guide you through preparing your LDAP server and provide details about how to install the LDAP module on Jive Messenger. These instructions assume that you're a competent LDAP user, and that you're familiar with Jive Messenger setup issues. The iPlanet Directory Server 5.0 LDAP server was used for development and testing, but any LDAP compliant server should also work.

## Choosing an LDAP storage mode

Two modes for storing user data in an LDAP directory are supported:

1. Mixed Mode (LDAP and User Database) -- Username, name and email are stored in LDAP. All Jive-specific data is stored in the Jive Messenger user database. This mode requires no changes to your LDAP directory.
2. Pure LDAP Mode -- All user data is stored in LDAP, including Messenger-specific data. This mode requires you to make changes to your LDAP schema.

The first option is easier to setup and is generally the better solution. However, the second option is also appropriate in some cases.

## Configuration

In order to configure your server to use LDAP you need complete the following tasks:

1. Stop Messenger.
2. Edit `MESSENGER_HOME/config/jive-messenger.xml` as described below.
3. Restart Messenger.

### Configure Messenger

Open the Messenger configuration file `MESSENGER_HOME/config/jive-messenger.xml` in your favorite editor and add or change the following settings:

- UserProvider.properties.className
- UserProvider.info.className
- ldap.host - LDAP server host; e.g. localhost or machine.example.com, etc.
- ldap.port - LDAP server port number
- ldap.usernameField - The field name that the username lookups will be performed on.
- ldap.baseDN - The starting DN that searches for users will performed with. The entire subtree under the base DN will be searched for user accounts.
- ldap.nameField - The field name that holds the user's name.
- ldap.emailField - The field name that holds the user's email address.
- ldap.adminDN - A directory administrator's DN. All directory operations will be performed with this account. For normal usage of the module, the admin should have full administrative controls over the directory.
- ldap.adminPassword - The password for the directory administrator.
- ldap.debugEnabled - A value of "true" if debugging should be turned on. When on, trace information about buffers sent and received by the LDAP provider is written to System.out
- ldap.sslEnabled - Enable SSL connections to your LDAP server. If you enable SSL connections, the LDAP server port number most likely should be changed to 636.

Below is a sample set up.

    <jive>
    ...
      <UserProvider>
        <properties>
          <className>org.jivesoftware.messenger.ldap.LdapUserPropertiesProvider</className>
        </properties>
        <info>
          <className>org.jivesoftware.messenger.ldap.LdapUserInfoProvider</className>
        </info>
      <UserProvider>
      <ldap>
        <host>myhost.com</host>
        <port>389</port>
        <usernameField>uid</usernameField>
        <emailField>mail</emailField>
        <baseDN>o=mycompany, c=mycountry</baseDN>
        <nameField>cn</nameField>
        <adminDN>cn=ldap-administrator</adminDN>
        <adminPassword>adm1npwd</adminPassword>
        <debugEnabled>false</debugEnabled>
        <sslEnabled>false</sslEnabled>
      </ldap>
    ...
    </jive>