JAASRealm to use LdapLoginModule in Tomcat
843811Jun 6 2008 — edited Jun 10 2008Hi All,
I am trying to configure JAASRealm in Tomcat and use Java 6's LdapLoginModule to authenticate and authorize users against LDAP. My requirement is to bind with LDAP using a userid from one branch and thereon authenticate using userid from a different branch. LDAP is configured not to allow non-anonymous bind.
Here is my configuration.
Server.xml
---------------
<Realm className="org.apache.catalina.realm.JAASRealm" appName="TEST" />
JAAS Config
------------------
TEST {
com.sun.security.auth.module.LdapLoginModule REQUIRED
userProvider="ldap://localhost:389/ou=employee,dc=test,dc=com"
authIdentity="uid={USERNAME},ou=employee,dc=test,dc=com"
};
The user i am trying to authenticate belongs to ou=employee,dc=test,dc=com and the user that i am trying to bind belongs to mycompany branch in the LDAP.
Is there a way to configure bind userid & password directly in the JAAS config ?