Home Contact Download
Open source connector to synchronize identities to a LDAP directory from any data source including any database with a JDBC connector, another LDAP server or flat files ...
Download  |  Read more...  |  Get started!

Quickstart tutorial

A sample configuration with some data is included in the LSC download. This page will show you how to run it, to get started with LSC.

This demo uses CSV data, a Java embedded database (HSQLDB) and directory (OpenDS), so it just works out of the box :)

Follow the steps below to get a feel of what LSC can do!

Download the latest version of LSC

  1. Make sure you have a JVM installed. See the Requirements.
  2. Download the latest lsc-core-1.2.X-dist.tar.gz archive from the download area (or .zip, as you prefer)
  3. Decompress the archive and enter the directory:
$ tar xzf lsc-core-1.2*-dist.tar.gz
$ cd lsc-1.2*

Our data source: a CSV file of users

In the sample/sample.csv file is a list of users, with their information stored in CSV format. Have a look at this file to see the contents.

The aim of this demonstration is to synchronize this file into a LDAP directory.

Load the CSV file into a database

For LSC to read data from the CSV file, we must load it into a database. This demonstration uses an embedded database, HSQLDB, so no installation or configuration is necessary.

To set up a new database and import the CSV file, run this command:

$ sample/bin/lsc-sample --import sample/sample.csv

If all goes well, this should display a few lines of messages:

Table csvdata created
11 lines added to table csvdata

You can change the data in the CSV file and repeat this step as many times as you want. The database will be reinitialized each time.

If you see an error message like the following, just try again.

Error - file '' not found

Check the contents of the database

Now, let's see what the database contains. Run the following command:

$ sample/bin/lsc-sample --show

You should see a simple table containing the information from our CSV file, sample/sample.csv.

Our data destination: an empty LDAP directory

An open source directory server, OpenDS, is bundled in the sample directory of LSC. To launch it, you need a separate shell, so you can leave it running:

$ sample/bin/lsc-sample --start-ldap-server

If all goes well, this should display a few lines of messages:

Starting LDAP server on ldap://localhost:33389/ ...
10766 - INFO  - LDIF sample content loaded successfully

Note: This may take a minute or two to launch. Please be patient!

Check the contents of the directory

Using whatever LDAP browser you like, check out the contents of the directory. The parameters to connect are:

You should see only two entries, the basic structure:

Note: We recommend Apache Directory Studio as a nice multiplatform, graphical LDAP browser.

Run the synchronization

Now we have a data source and an empty LDAP directory just waiting for us to write in it, let's fire up LSC.

From now on, use a different terminal from the one the LDAP directory is running in.

A wrapper script make it easy to launch, just run this command from the main directory:

$ sample/bin/lsc-sample --run

This will display:

Running /usr/local/lsc-1.2.0/bin/lsc \
--config /usr/local/lsc-1.2.0/sample/etc --synchronize all

This actually runs the bin/lsc command, telling it to use the sample/etc directory for configuration, and synchronize all defined tasks.

Detailed information about added entries will then be printed, before a summary line:

All entries: 11, to modify entries: 11, modified entries: 11, errors: 0

Admire the results

Now this synchronization has run, your LDAP directory should contain one entry for each line from our CSV file:

Run it again

If you launch the synchronization again, you'll see that nothing more is changed in the directory. This is because LSC compares all the data from our source, and works out that everything is up to date:

All entries: 11, to modify entries: 0, modified entries: 0, errors: 0

Play around

Now you have the basic synchronization working, have a play around with the data and settings, to get a feel for what LSC can do.

Here are some examples:

  1. Edit some names in sample/sample.csv and reload the file:
    $ sample/bin/lsc-sample --import sample/sample.csv

    Then re-run the synchronization, to see how simple modifications are synchronized:

    $ sample/bin/lsc-sample --run
  2. Read the main configuration file in sample/etc/lsc.properties and add the following line to the file.
    lsc.syncoptions.MySyncTask.sn.force_value = \
    srcBean.getAttributeValueById("sn").toUpperCase()

    Then re-run the synchronization (sample/bin/lsc-sample –run), and you'll see all surnames are now in capitals.

When you're done with the sample, you can stop the LDAP server by pressing “Control-C” in it's shell. Then, simply remove the whole directory (if you want):

$ rm -r sample

What's next?

Once you've had a play with this sample data, you probably want to move on to your own synchronization.

The main configuration file is in etc/lsc.properties. It is the same format as the one from the sample, so you'll be able to use it quickly. A sample file is provided in etc/lsc.properties-sample, just rename it to get started.

Read through the documentation on this web site. If you need help or have a question, get in touch by mailing lists or IRC.

Last but not least, we really hope you enjoy using LSC, and it solves problems for you. We'd love to hear back from you.