JNDIRealm on Tomcat 5.0

Hi All,

I have installed Tomcat 5.0 and iPlanet 5.1 Directory server. I need to authenticate the users from the user directory on iPlanet.

In my web.xml I had made the following changes,

<security-constraint>

<web-resource-collection>

<web-resource-name>MyWebApp</web-resource-name>

<description> accessible by authenticated users of the tomcat role</description>

<url-pattern>/*</url-pattern>

<http-method>GET</http-method>

<http-method>POST</http-method>

<http-method>PUT</http-method>

<http-method>DELETE</http-method>

</web-resource-collection>

<auth-constraint>

<description>These roles are allowed

access</description>

<role-name>My Server Group name</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

<realm-name>MyWebApp Protected Area</realm-name>

<form-login-config>

<form-login-page>/login.html</form-login-page>

<form-error-page>/autherr.html</form-error-page>

</form-login-config>

</login-config>

<security-role>

<description>My web Application</description>

<role-name>My Server Group name</role-name>

</security-role>

<RealmclassName="org.apache.catalina.realm.JNDIRealm" debug="99"

connectionURL="ldap://IP:port"

userBase="ou=People,cn=Company name, cn=domain"

userSearch="(uid={0})"

roleBase="ou=Groups"

roleName="cn=Directory Manager"

roleSearch="(uniqueMember={0})"

/>

[2073 byte] By [reflex2javaa] at [2007-11-26 15:51:09]
# 1
I am getting a popup prompting me for username and password. but if I give any username/password that is on the iPlanet server it fails and shows aan authentication fail exception.Can someone throw some light on to what exactly has to be done on tomcat.
reflex2javaa at 2007-7-8 22:11:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I have also put the ldap.jar downloaded from Sun site on classpath.
reflex2javaa at 2007-7-8 22:11:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I'm not familiar with iPlanet but when I started working with JNIDRealm i had to change the roleSsearch parameter.

I had to configure it as roleSearch="member={0}" , which is the directory attribute of the roleBase (ou=Groups) where the members are stored. Additionally, roleName is just the attribute that stores the role names (i.e. cn) My role name looks like roleName="cn".

Hope this helps

dev_crstopa at 2007-7-8 22:11:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...