(Quick Reference)

4 Configuration - Reference Documentation

Authors: Lucas Rockwell

Version: 0.5.0

4 Configuration

Overview

This section describes how to configure the DirectoryService plugin.

Define The DIT

Instead of crawling your LDAP directory, DirectoryService expects you to give it some hints about how your server is set up. Once you configure the plugin, it will become obvious to you how it works.

Since the DIT definition is a Map, you must put it in a .groovy file. The easiest place to put it is in Config.groovy, but you can put it into any config file you have defined.

For this example, we are going to assume that our LDAP tree has three branches that we are interested in mapping:

ou=people,dc=someu,dc=edu
ou=departments,dc=someu,dc=edu
ou=groups,dc=someu,dc=edu

So, we need to tell DirectoryService about these branches, including the singular and plural names of the objects in those branches, the RDN attribute for the objects in those branches, and the source, i.e., what server contains this information.

The above branches would be defined in the directoryService.dit as follows:

grails.plugins.directoryservice.dit = [
    'ou=people,dc=someu,dc=edu':[
        'singular':'person',
        'plural':'people',
        'rdnAttribute':'uid',
        'source':'directory'
    ],
    'ou=departments,dc=someu,dc=edu':[
        'singular':'department',
        'plural':'departments',
        'rdnAttribute':'ou',
        'source':'directory'
    ],
    'ou=groups,dc=someu,dc=edu':[
        'singluar':'group',
        'plural':'groups',
        'rdnAttribute':'uid',
        'source':'directory'
    ]
]

See the table below for definitions of the various elements of the map:

AttributeMeaningNotes/Example
singularThe singular spelling for the name of the tree.This does not have to match the name in the DN.
pluralThe plural spelling for the name of the tree.This does not have to even be the plural version of singular, but you probably what to keep these things consistent for your own sanity.
rdnAttributeThis is the attribute which makes up the RDN of the entry.If the DN of a person is uid=125236,ou=people,dc=someu,dc=edu, then the rdnAttribute would be "uid". If the DN of a person is cn=Rockwell, Lucas,ou=people,dc=someu,dc=edu, then the rdnAttribute would be "cn". This must be the real RDN attribute, i.e., you can't make this up.
sourceThis is the sourceThis points to an entry in grails.plugins.directoryservice.sources.

One Branch, Multiple Objects

Store more than one object type in the same branch? No problem! Map keys are case sensitive, so you can define multiple objects in the same branch by changing the case of at least one character in the dn. For example, let's say you have both people and accounts in the "people" branch (don't know why you would, but let's just say you do), and the rdnAttribute of people is "uid", and the rdnAttribute of accounts is "cn":

grails.plugins.directoryservice.dit = [
    'ou=people,dc=someu,dc=edu':[
        singular: 'person',
        plural: 'people',
        rdnAttribute: 'uid',
        source: 'directory'
    ],
    'ou=People,dc=someu,dc=edu':[
        singular: 'account',
        plural: 'accounts',
        rdnAttribute: 'cn',
        source: 'directory'
    ]
]

See the examples in the Usage section for details on how these various elements are utilized.

Define Sources

In the dit definition above, there is an attribute named "source". This points to a directory server configured in grails.plugins.directoryservice.sources. For instance:

grails.plugins.directoryservice.sources = [
    'directory':[
        address: 'server1,server2',
        port: '636,636',
        useSSL: true,
        trustSSLCert: true,
        followReferrals: true,
        bindDN: 'cn=Directory Manager',
        bindPassword: 'password'
    ]
]

See the table below for information on what each attribute means:

More Examples

For more examples of how to configure the dit and sources, see the Config.groovy file in the main project: .