Spring LDAP in dev environment

1.2k views Asked by At

I'm building a spring boot application which use LDAP interaction for authentication but not only. I also retrieve information from LDAP for my users details.

I don't know how to manage this for a dev environment which does not have access to real LDAP.

Ldif file ? Embedded Apache DS Server ?

Thanks

1

There are 1 answers

0
Pratik Ambani On

So you want to mock LDAP in your local environment.

You'll need to,

  1. inject JNDI implementation
  2. implement JNDI layer
  3. write mock which will return desired data.

Refer below mentioned link describing step by step guide to mock LDAP. Tried similar in 2014, hope it work for others.

Reference: https://theholyjava.wordpress.com/2010/05/05/mocking-out-ldapjndi-in-unit-tests/

Note: Please rephrase your query so that others with similar issue can also benefit it. Happy coding :)