From aed8aa22fd9e388af9999cf70931639845eda1a0 Mon Sep 17 00:00:00 2001
From: markt
The UserDatabase Realm is a Realm implementation + that is based on a UserDatabase resource made available through the global + JNDI resources configured for this Tomcat instance.
+ +The Memory Based Realm implementation supports the following + additional attributes:
+ +The name of the resource that this realm will use for user, password + and role information.
+See the + Container-Managed Security Guide for more + information on setting up container managed security using the UserDatabase + Realm component and the + JNDI resources how-to for more + information on how to configure a UserDatabase resource.
+The Memory Based Realm is a simple Realm implementation
diff --git a/webapps/docs/jndi-resources-howto.xml b/webapps/docs/jndi-resources-howto.xml
index 64f0be327..b9b98d453 100644
--- a/webapps/docs/jndi-resources-howto.xml
+++ b/webapps/docs/jndi-resources-howto.xml
@@ -309,6 +309,71 @@ writer.println("foo = " + bean.getFoo() + ", bar = " +
+ UserDatabase resources are typically configured as global resources for
+ use by a UserDatabase realm. Tomcat includes a UserDatabaseFactoory that
+ creates UserDatabase resources backed by an XML file - usually
+ The steps required to set up a global UserDatabase resource are described
+ below. The XMl file is typically located at
+ Next, modify The The Configure a UserDatabase Realm to use this resource as described in the
+ Realm configuration documentation.0. Introduction
+
+ tomcat-users.xml1. Create/edit the XML file
+
+ $CATALINA_BASE/conf/tomcat-users.xml however, you are free to
+ locate the file anywhere on the file system. It is recommended that the XML
+ files are placed in $CATALINA_BASE/conf. A typical XML would
+ look like:2. Declare Your Resource
+
+ $CATALINA_BASE/conf/server.xml to create the
+ UserDatabase resource based on your XMl file. It should look something like
+ this:pathname attribute can be absolute or relative. If
+ relative, it is relative to $CATALINA_BASE.readonly attribute is optional and defaults to
+ false if not supplied. If the XML is writeable then it will be
+ written to when Tomcat starts. WARNING: When the file is
+ written it will inherit the default file permissions for the user Tomcat
+ is running as. Ensure that these are appropriate to maintain the security
+ of your installation.3. Configure the Realm
+
+ 0. Introduction
diff --git a/webapps/docs/realm-howto.xml b/webapps/docs/realm-howto.xml
index 7b5b8b479..ea0c3095a 100644
--- a/webapps/docs/realm-howto.xml
+++ b/webapps/docs/realm-howto.xml
@@ -119,6 +119,9 @@ sources of authentication information:
conf/tomcat-users.xml).conf/tomcat-users.xml).UserDatabaseRealm is an implementation of the Tomcat 6
+Realm interface that uses a JNDI resource to store user
+information. By default, the JNDI resource is backed by an XML file. It is not
+designed for large-scale production use. At startup time, the UserDatabaseRealm
+loads information about all users, and their corresponding roles, from an XML
+document (by default, this document is loaded from
+$CATALINA_BASE/conf/tomcat-users.xml). The users, their passwords
+and their roles may all be editing dynamically, typically via JMX. Changes may
+be saved and will be reflected in the XMl file.
To configure UserDatabaseRealm, you will create a <Realm>
+element and nest it in your $CATALINA_BASE/conf/server.xml file,
+as described above. The attributes for the
+UserDatabaseRealm are defined in the Realm
+configuration documentation.
The users file uses the same format as the +MemoryRealm.
+ +The default installation of Tomcat 6 is configured with a UserDatabaseRealm
+nested inside the <Engine> element, so that it applies
+to all virtual hosts and web applications. The default contents of the
+conf/tomcat-users.xml file is:
UserDatabaseRealm operates according to the following rules:
+authenticate() method of this
+ Realm.MemoryRealm is a simple demonstration implementation of the
Tomcat 6 Realm interface. It is not designed for production use.
At startup time, MemoryRealm loads information about all users, and their
-corresponding roles, from an XML document (by default, this document is loaded from $CATALINA_BASE/conf/tomcat-users.xml). Changes to the data
+corresponding roles, from an XML document (by default, this document is loaded
+from $CATALINA_BASE/conf/tomcat-users.xml). Changes to the data
in this file are not recognized until Tomcat is restarted.
The default installation of Tomcat 6 is configured with a MemoryRealm
-nested inside the <Engine> element, so that it applies
-to all virtual hosts and web applications. The default contents of the
-conf/tomcat-users.xml file is:
MemoryRealm operates according to the following rules:
-- 2.11.0