简体   繁体   English

开发环境中的Spring LDAP

[英]Spring LDAP in dev environment

I'm building a spring boot application which use LDAP interaction for authentication but not only. 我正在构建一个使用LDAP交互进行身份验证的Spring Boot应用程序,不仅如此。 I also retrieve information from LDAP for my users details. 我还从LDAP检索信息以获取用户详细信息。

I don't know how to manage this for a dev environment which does not have access to real LDAP. 我不知道如何针对无法访问真实LDAP的开发环境来管理它。

Ldif file ? ldif文件? Embedded Apache DS Server ? 嵌入式Apache DS服务器?

Thanks 谢谢

So you want to mock LDAP in your local environment. 因此,您想在本地环境中模拟LDAP。

You'll need to, 您需要

  1. inject JNDI implementation 注入JNDI实现
  2. implement JNDI layer 实施JNDI层
  3. write mock which will return desired data. 写模拟将返回所需的数据。

Refer below mentioned link describing step by step guide to mock LDAP. 请参考下面提到的链接,该链接描述了模拟LDAP的逐步指南。 Tried similar in 2014, hope it work for others. 在2014年尝试类似,希望它对其他人有用。

Reference: https://theholyjava.wordpress.com/2010/05/05/mocking-out-ldapjndi-in-unit-tests/ 参考: 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 :) 快乐的编码:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM