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

Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator’s Guide544548-004
3-37
DataSourceRealm
For more information on configuring JAASRealm or creating your own login module,
refer the Tomcat 6.0 Specification at
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html.
DataSourceRealm
DataSourceRealm is an implementation of the NSJSP Realm interface that uses a
user database accessed using a JNDI named JDBC DataSource. Similar to the
JDBCRealm, the DataSourceRealm requires a set of underlying SQL database
tables to be available.
DataSourceRealm can be configured in the server.xml configuration file nested
inside a service or a virtual host. In addition, it can also be configured for a specific
context by nesting the <Realm> element inside the <Context> element in the context
configuration file. Example 3-17 shows an example of DataSourceRealm
configuration.
DataSourceRealm Element Attributes
To configure DataSourceRealm, create a <Realm> element and nest it in your
NSJSP_HOME/conf/server.xml file or in the <Context> element in the context
configuration file, as in Example 3-9 on page 3-23. These attributes are supported for
DataSourceRealm.
className
The value is org.apache.catalina.realm.DataSourceRealm.
dataSourceName
Specifies a defined JNDI named JDBC DataSource for your database.
digest
The digest algorithm used to store passwords in non-plain text formats. Valid
values are those accepted for the algorithm name by the
java.security.MessageDigest class. For more information, see Digested
Passwords on page 3-39. If not specified, passwords are stored in clear text.
Example 3-17. DataSourceRealm
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/userDB"
roleNameCol="role_name"
userCredCol="user_pass"
userNameCol="user_name"
userRoleTable="mycatalog.myschema.USERROLE"
userTable="mycatalog.myschema.USERS" />