NonStop Servlets for JavaServer Pages (5.0) System Administrator's Guide

Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide525644-002
3-31
JDBCRealm
roles
Comma-delimited list of the role names associated with this user.
The default contents of the $NSJSP_HOME/conf/tomcat-users.xml file are shown
in Example 3-21.
MemoryRealm operates according to the following rules:
When NSJSP first starts up, it loads all defined users and their associated
information from the users file. Changes to the data in this file are not recognized
until NSJSP is restarted.
When a user attempts to access a protected resource for the first time, the NSJSP
container calls the authenticate() method of this Realm.
Once a user has been authenticated, the user (and the associated roles) is cached
within NSJSP for the duration of the user's login. (For FORM-based authentication,
the duration lasts until the session times out or is invalidated; for BASIC and
DIGEST authentication, the duration last until the user closes the browser).
Administering the information in the users file is the responsibility of your
application. The NSJSP container does not provide any built-in capabilities to
maintain users and roles.
Debugging and exception messages logged by this realm are recorded by the
<Logger> that is associated with the surrounding <Context>, <Host>, or
<Engine>. By default, the corresponding <Logger> creates a log file in the
$NSJSP_HOME/logs directory.
JDBCRealm
JDBCRealm is an implementation of the NSJSP Realm interface that looks up users in
a relational database accessed through a JDBC driver. The substantial configuration
flexibility lets you adapt to existing table and column names, as long as your database
structure conforms to the following requirements:
A users table must exist, as referenced in Example 3-22, that contains one row
for every valid user that this realm should recognize. The users table must
contain at least two columns (it can contain more according to the requirements of
your existing applications):
°
User name, to be recognized by the NSJSP container when the user logs in.
Example 3-21. Default User File Format
<tomcat-users>
<user name="tomcat" password="tomcat" roles="tomcat" />
<user name="role1" password="tomcat" roles="role1" />
<user name="both" password="tomcat" roles="tomcat,role1" />
/tomcat-users>