5.3.5 WebPasswordJDBCLoginModule
WebPasswordJDBCLoginModule is the login module used when the database is already used for user management.
It uses the entered user ID and password to retrieve the password from the user information stored in the database.
To use this module, specify the definition to connect to the database and the SQL used to retrieve entries (SELECT statement) in ua.conf (the integrated user management configuration file).
WebPasswordJDBCLoginModule reads this file, obtains the user ID from HttpServletRequest, uses JDBC to access to the database and search for the password, and then uses the password to perform password authentication. The following figure shows an overview of WebPasswordJDBCLoginModule.
|
|
In addition, WebPasswordJDBCLoginModule references the JDBC driver classes in the login module. The available JDBC drivers and the procedures to set up the JDBC driver are as follows.
- Organization of this subsection
(1) Available JDBC drivers
The following table lists the databases and JDBC drivers used by WebPasswordJDBCLoginModule.
|
Database |
JDBC driver |
|
|---|---|---|
|
HiRDB# |
HiRDB Type4 JDBC Driver |
|
|
Oracle |
Oracle 11g |
Oracle JDBC Thin Driver |
|
SQL Server |
SQL Server JDBC Driver |
|
#: Includes HiRDB Run Time
(2) Procedures to set up the JDBC driver
Set the JDBC driver class in ua.conf (the integrated user management configuration file). Store the JDBC driver in any directory, and then add that directory to the J2EE server class path. The setup procedures are as follows:
-
Enter the following items in ua.conf (the integrated user management configuration file).
-
The JDBC driver class name that corresponds to the used JDBC driver
-
The database and the URL to connect to that database
-
Delegate database users and their passwords
The setup examples for databases are as follows: Replace the bold letters with the appropriate ones depending on the database environment.
- HiRDB:
-
com.cosminexus.admin.auth.jdbc.driver.0=JP.co.Hitachi.soft.HiRDB.JDBC.HiRDBDriver
com.cosminexus.admin.auth.jdbc.conn.url.0=jdbc:hitachi:hirdb://DBID=22200,DBHOST=hostA
com.cosminexus.admin.auth.jdbc.conn.user.0=system
com.cosminexus.admin.auth.jdbc.conn.password.0=userpass
- Oracle:
-
com.cosminexus.admin.auth.jdbc.driver.0=oracle.jdbc.OracleDriver
com.cosminexus.admin.auth.jdbc.conn.url.0=jdbc:oracle:thin:@localhost:1521:orcl
com.cosminexus.admin.auth.jdbc.conn.user.0=system
com.cosminexus.admin.auth.jdbc.conn.password.0=userpass
- SQL Server:
-
com.cosminexus.admin.auth.jdbc.driver.0=com.microsoft.sqlserver.jdbc.SQLServerDriver
com.cosminexus.admin.auth.jdbc.conn.url.0=jdbc:sqlserver://localhost:1433;DatabaseName=sqlserver
com.cosminexus.admin.auth.jdbc.conn.user.0=system
com.cosminexus.admin.auth.jdbc.conn.password.0=userpass
-
-
Store the JDBC driver JAR file in any directory of the machine running the J2EE server.
-
Enter the path of the JAR file stored in Step 2 in usrconf.cfg (the option definition file) of the J2EE server.
The setup example is as follows:
add.class.path=directory stored in Step 2/JAR file name
Note that the JAR file name depends on the database to be connected.
(3) Notes
-
When using the Oracle database, specify a variable-length character string such as VARCHAR2 in the column (USERID, etc.) of the user information table created in the database. If a fixed-length character string such as CHAR is specified, password authentication may fail.
-
The Windows authentication is not supported as the SQL Server authentication mode.