I'm working on a java web application for which login should be authenticated using an existing ldap server. I do not need information of the user to be taken from the server. I only need to check whether the username and password exist in ldap. I use tomcat server for the web application.
This is something I found searching the internet which should be included in the server.xml file with relevant parameters in tomcat server. I did everything said in this particular guide.
source http://ldapwiki.willeke.com/wiki/Tomcat%20And%20LDAP
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="10"
connectionURL="ldaps://192.168.0.8:636"
alternateURL="ldap://192.168.0.7:636"
userBase="ou=people,dc=willeke,dc=com"
userSearch="(cn={0})"
userSubtree="true"
userRoleName="dictcrole"
connectionName="cn=admin,ou=...,dc=willeke,dc=com"
connectionPassword="removed"
/>
I don't have much understanding about xml and servers. Can someone guide me to do this with a servlet?