akshay
akshay

Reputation: 115

web based java application to read LDAP

I want to make a web based Java application that reads an LDAP compliant directory and creates a record in a database for each user and group in the directory.

How can i go about it?

Upvotes: 0

Views: 723

Answers (3)

skaffman
skaffman

Reputation: 403471

The general API for talking to directory services (including LDAP) in Java is JNDI (javax.naming).

The official documentation for LDAP is rubbish, but there's a good tutorial on JavaWorld here.

Upvotes: 0

duffymo
duffymo

Reputation: 308763

I've used the Spring LDAP module to interact with directories. It works very well, same as all Spring code. You would use whatever relational database technology you wish to write to the database. If you're already using Spring, this won't be difficult. In this case you'd create a connection to an LDAP to read the data and another to the database to write it.

But there's a question here that's worth asking: Why do you feel like you need to duplicate the data? The DRY principle would discourage you from doing so. Wouldn't it be better to have all the information in one place or the other?

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1500385

I don't see how being web-based will affect things, so long as the web server has access to the LDAP directory - you'd use classes under javax.naming.

If you want to access a directory which the browser has access to but not the web server, you'll need to write code to run on the client instead - possible a JNLP application with appropriate access to make network connections.

Upvotes: 0

Related Questions