tomcat JNDIRealm authentication not working
I need to configure tomcat to prompt a basic authentication dialogue and authenticate users against the Active Directory. I could get the dialogue but after entering the valid userid and password I get the "authentication failed" messages.
Please guide me on how to resolve the issue?
Here are the steps that I followed.
1. Copied JNDI.jar and ldap.jar to tomcat/server/lib folder
2. In the server.xml file added following,
<Realm name="test" className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://agni:389"
userBase="CN=Users,dc=company,dc=com"
userSearch="(userPrincipalName={0})"
userRoleName="member"
roleBase="CN=Users,dc=company,dc=com"
roleName="cn"
roleSearch="(member={0})"
connectionName="CN=Administrator,CN=Users,DC=compa ny,DC=com"
connectionPassword="adminpass"
roleSubtree="true"
userSubtree="true" />
[Here for 'company' I used my company's domain]
3. In Web.xml file I added
<security-constraint>
<web-resource-collection>
<web-resource-name>
Entire Application
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>test</realm-name>
</login-config>
4. Restarted tomcat
System: Windows 2000,tomcat 4.1.24, jdk1.4.1
|