magallanes
magallanes

Reputation: 6854

Ldap server for developer

I am developing a project and that requires ldap validation. But, I don't have a developer/qa ldap server.

Does a small ldap server exist for windows for testing/development?.

I just want to test to validate a active account and detect if it is blocked or not, so i don't want to install a whole domain to do that.

---never mind---

I tried an compiled openldap but I was unable to understand it. Simply, I don't get how to connect to it, how to create a account and how to validate, the client ldap returned me some obfuscate error message, i tried several ways to do it and finally i give up.

Finally, i installed a domain, it was absurdly easy to install (2008 r2), restart the server and that's it.

Anyways, thanks for the advice of opendlap and aldps

Upvotes: 15

Views: 28407

Answers (10)

Patricio Diaz
Patricio Diaz

Reputation: 97

You can use a Docker container with Samba as Domain controller, here I show how to setup one in just a few minutes

Basically you need to

  1. Create an image with this (read the post if you want to know why)
$ git clone https://github.com/padiazg/alpine-samba-ad-container.git
$ cd alpine-samba-ad-container
# replace your-user with your username
$ docker build -t your-user/alpine-samba-ad-container .
  1. Create some folders and files to persist the container data
mkdir /tmp/krb-conf
&& mkdir /tmp/krb-data
&& mkdir /tmp/smb-conf
&& modir /tmp/smb-data
&& touch /tmp/krb-conf/krb5.conf
  1. Run the container
docker run -d \
-e SAMBA_ADMIN_PASSWORD=a-secure-password \
-e SAMBA_DOMAIN=local \
-e SAMBA_REALM=local.your-domain.io \
-e LDAP_ALLOW_INSECURE=true \
--mount type=bind,source=/tmp/krb-conf/krb5.conf,target=/etc/krb5.conf \
--mount type=bind,source=/tmp/krb-data,target=/var/lib/krb5kdc \
--mount type=bind,source=/tmp/smb-conf,target=/etc/samba \
--mount type=bind,source=/tmp/smb-data,target=/var/lib/samba \
-p 389:389 \
--name smb4ad \
your-user/alpine-samba-ad-container

And now you are good to go

Upvotes: 1

MarterJay
MarterJay

Reputation: 135

Try simple-ldap-server

I know its pretty late to answer this question. But for the reference of someone who runs into the same question.

I wrote a simple ldap server(using ldapjs on nodejs) for authentication testing purposes. Please feel free to use it. It's easy to configure. Can support both LDAP/LDAPS protocols, just require a json file including the user ids you want to add(or it comes with a pre-included users json file, which you can use if you want). The project is on github. (I'll add a docker image too) Feel free to visit and use

Docker image

Simple Ldap Server Git

Upvotes: 1

Stefan Steiger
Stefan Steiger

Reputation: 82186

Necromancing.
I've had the same problem.

OpenDS is very easy to get up and running, and doesn't require administrator rights.
You just need to download the ZIP file and run the installer.
The installer can populate the directory with test entries, too - if you want to see some example data.
That's exactly what you're looking for when wanting a simple dev test server.

Note:
OpenDS development has seized, and was forked into OpenDJ, a commercial project by forgerock.
While OpenDS still works on Java7, only OpenDJ will work with Java8.

However, OpenDJ is still FREE and OpenSource.
You can find the sourcecode here on Bitbucket and you can grab it with git:

git clone https://stash.forgerock.org/scm/opendj/opendj.git

Forget OpenLDAP and AD-LDS; these are way too complicated for simple testing.
In addition, their user interface is horrible, and you need something that you can get up and running FAST, without admin rights, and have it populated with test data in a few minutes, not in a few weeks.
And ApacheDS will require administrator privileges, unfortunately (because it only works as windows service, and you can't start/stop these without being administrator).

So OpenDJ is the definite way to go.

Apache Directory Studio is a good client to browse, edit and import/export data via LDAP (LDIF).
However, despite Apache Directory Studio being written in Java, it adds a dependency to gtk, and only has binaries for x86/x64, which means it won't work on a Chromebook with ARM processor, or on a RaspberrryPI.

But with the test entries added automagically in OpenDJ/OpenDS (if you choose the option), you don't even need that.
When in doubt, use a web based interface that "talks LDAP".

Upvotes: 2

Brad Peabody
Brad Peabody

Reputation: 11377

You could roll your own LDAP server for testing pretty easily using godap: https://github.com/bradleypeabody/godap

It's written in Go. It's very small and simple.

You would basically need to copy the server example out of godap_test.go and wire it up however you need.

Upvotes: 1

Gene Vincent
Gene Vincent

Reputation: 5469

Active Directory works fine as an LDAP server and its included in the Windows Server 2008 trial. See the answer to my question Testing LDAP Connections to Active Directory Server. I have it running in a KVM virtual machine on Linux and query it from an OpenLDAP based client.

Upvotes: 3

user207421
user207421

Reputation: 310885

OpenLDAP. Ships with most Unixes and Linuxes. For Windows it is available from several sources:

Upvotes: 0

Doug Hou
Doug Hou

Reputation: 560

Apache provide a directory server called "ApacheDS"(Apache Directory Server), and it provides a GUI management client called "Apache Directory Studio" which is based on Eclipse.

If you want to have a test only, this studio provides a built-in server for your test, easy to link.

You can also install the studio directly in Eclipse using this update site: http://directory.apache.org/studio/update/2.x/

Upvotes: 5

sdorra
sdorra

Reputation: 2392

Try OpenDS it is very simple and requires only Java.

Upvotes: 1

marc_s
marc_s

Reputation: 754438

If you're on Windows and use Active Directory, have a look at Active Directory Lightweight Directory Services (AD LDS) - a LDAP server you can install and use on your dev machine.

Upvotes: 10

MrEyes
MrEyes

Reputation: 13690

The open source LDAP server from OpenLDAP should give you what you need:

http://www.openldap.org/

Upvotes: 4

Related Questions