NonStop Servlets for JSP System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-001
3-22
JDBCRealm
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 will not be
recognized until NSJSP is restarted.
•
When a user attempts to access a protected resource for the first time, the NSJSP
container will call the authenticate() method of this Realm.
•
Once a user has been authenticated, the user (and his or her associated roles) is
cached within NSJSP for the duration of the user's login. (For FORM-based
authentication, that means until the session times out or is invalidated; for BASIC
authentication, that means 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 will be recorded by the
<Logger> that is associated with our surrounding <Context>, <Host>, or
<Engine>. By default, the corresponding <Logger> will create a log file in the
iTPWS_INSTALL_DIR/servlet_jsp/logs directory
JDBCRealm
JDBCRealm is an implementation of the NSJSP Realm interface that looks up users in
a relational database accessed via a JDBC driver. There is substantial configuration
flexibility that 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-20, 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 if your existing applications require it):
°
Username, to be recognized by the NSJSP container when the user logs in.
°
Password, to be recognized by the NSJSP container when the user logs in.
This value can be in clear text or digested as described under Digested
Passwords on page 3-31.
Example 3-19. 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>