0

I have Spring boot project that is already using Spring security for Admin panel. In the front-end, I just want to use AD LDAP just to check if the user is present in the company's active directory or not. No login page is required for front-end users and therefore no need to LDAP Authentication builder. I want to use LDAP search function in the HomeController that's it.

I have been looking for the solution but everywhere LDAP is used along with Spring security. I do not want that. I just want to make use of LDAP search function to find users based on username.

sac2811
  • 1
  • 3
  • 1
    The class you're looking for is org.springframework.ldap.core.support.LdapTemplate – WirelessKiwi Feb 12 '20 at 09:39
  • Hi! Maybe spring-ldap could work for you? (https://docs.spring.io/spring-data/ldap/docs/current/reference/html/#reference). Just declare the ldap as repository and declare a query method to search by userId. – Jaime S Feb 12 '20 at 09:41
  • @WirelessKiwi ... do you have a reference on how to use this in the spring boot project. Where to specify LDAP configuration details? – sac2811 Feb 12 '20 at 09:51
  • @JaimeS ... do you have a reference on how to use this in the spring boot project. Where to specify LDAP configuration details? – sac2811 Feb 12 '20 at 09:51
  • Check this https://docs.spring.io/spring-data/ldap/docs/current/reference/html/#ldap.repositories or https://www.baeldung.com/spring-data-ldap – Jaime S Feb 12 '20 at 09:59
  • Hi..I am now getting this exception: LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580 After googling, I found that this is about wrong credentials, but the same credentials I am using in other applications to connect to LDAP directory. Tried adding @domain also after the username but that also did not help. Any idea what is missing? – sac2811 Feb 13 '20 at 05:35
  • Thanks a ton guys for your help...spring-data-ldap and ldapTemplate solved my issue... – sac2811 Feb 13 '20 at 08:22

0 Answers0