Chapter 9 Managing Realm

A Realm is a database or storage of usernames and passwords which helps identify valid users. Realm also enumerates the list of roles associated with each valid user.

Tomcat 6 defines a Java interface that can be implemented by “plug in” components to establish a connection between a servlet container to some existing authentication database. The following lists the standard plug-ins which support connections to various sources of authentication information:

  • JDBCRealmA JDBC driver allows you to access authentication information stored in a relational database.
  • DataSourceRealm – A named JNDI JDBC Datasource allows you to access authentication information stored in a relational database.
  • JNDIRealmA JNDI provider allows you to access authentication information stored in an LDAP based directory server.
  • MemoryRealm – This allows you to access authentication information stored in an in-memory object collection.
  • JAASRealm – This allows you to access authentication information through the Java Authentication & Authorization Service (JAAS) framework.

If you wish to write your own Realm implementation and integrate it with Tomcat 6.0, perform the following steps:

1. Implement org.apache.catalina.Realm.

2. Store your compiled realm in $CATALINA_HOME/server/lib.

3. Declare your realm as described in the “Configuring a Realm” section.

4. Declare your realm to the MBeans Descriptor.


  • Currently 3.04/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
  Flag Inappropriate Content 0 comments