w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
LDAP Authentication with Spring Security throwing LDAP error 49, 52e for any userDn

userDN should be like that "cn=myUsername,ou=myDepartment,dc=mydomain,dc=com". your user name should contain partition name and another thing you can use spring security tags.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:s="http://www.springframework.org/schema/security"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/security
      
http://www.springframework.org/schema/security/spring-security.xsd">

    <s:ldap-server id="contextSource" url="${ldap.url}"
manager-dn="${ldap.userDn}"
                   manager-password="${ldap.password}"/>


</beans>

UPDATE:

your server url should contain partition name too. "ldap://10.0.0.1:389/DC=mycompany,DC=com,DC=tr"





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.