Thanks for your link Rahul
Here is what I did
Followed the instructions in tomcat page
1.Write LoginModule, User and Role classes based on JAAS to be managed by the JAAS Login Context (javax.security.auth.login.LoginContext) 2.Create separate classes to distinguish between users and roles,
3.Place the compiled classes on Tomcat's classpath
4.Set up a login.config file for Java
5.Configure the security-constraints in web.xml for the resources to be used -
6.Configure the JAASRealm module in your server.xml. � Configured settings
Anything else which I am missing ? I am trying to use this realm with a
J2EE app in tomcat/eclipse environment.