|
| WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
Package examples.security.rdbmsrealm
This package demonstrates how to implement a custom security realm in
WebLogic Server.
See:
Description
Class Summary |
RDBMSDelegate |
An instance of this class communicates
with a single database connection. |
RDBMSDelegate.DFactory |
A factory class that creates instances of the
RDBMSDelegate class for the purpose of pooling. |
RDBMSDelegate.Finished |
This class indicates to a caller that a method has
reached the end of a ResultSet. |
RDBMSGroup |
This class is the representation of a group from the database. |
RDBMSRealm |
This class represents empty groups or ACLs. |
RDBMSUser |
This is the in-memory representation of a user from the database. |
Exception Summary |
RDBMSException |
This exception is thrown if an error occurs in the RDBMS realm
code. |
Package examples.security.rdbmsrealm Description
This package demonstrates how to implement a custom security realm in
WebLogic Server. The RDBMS security realm stores Users, Groups, and ACLs in a relational
database. The RDBMS code example provides a Cloudscape database.
Perform the following steps in order to build and run the example:
- Build the example
- Set up the database
- Configure the server
- Run the example
Compile the RDBMS security realm. Run the build.cmd (Windows NT)
or build.sh (UNIX) script to
build the RDBMS security realm. The script compiles the Java classes into the
config/examples/serverclasses directory.
The Cloudscape Database
An evaluation copy of Cloudscape RDBMS
in shipped with the WebLogic Server code examples. The demo database shipped with
this version of Cloudscape includes a table that define an RDBMS security realm.
The RDBMS security realm uses three database tables: aclentries, groupmembers, and users. The DDL statements that create the realm and
some test data are in the file samples/examples/security/rdbmsrealm/rdbmsrealm.ddl.
Other Databases
-
Edit the rdbmsrealm.ddl file in
the weblogic600\samples\examples\security\rdbmsrealm
and make any changes required for your database. Be sure
not to change the table or column names. (If you must change anything,
you must make the corresponding changes in the config.xml file.)
You can also replace the test data with your data.
-
Set the property getGroupNewStatement to true if you have recursive groups (groups are members
of other groups) in your database. If your JDBC driver allows you
to have multiple results sets on the same PreparedStatement, you do not
have to set this property.
-
To use utils.Schema, you need a JDBC driver for your database.
See WebLogic Utilities
for help using utils.Schema.
To use the Cloudscape database:
- Bring up the
Administration Console in a browser.
- Select the Security node in the left pane.
- Select defaultCachingRealm for the Caching Realm field.
To use another database with the RDBMS example:
- Bring up the
Administration Console in a browser.
- Select the Realms node in the right pane.
- Select one of the pre-configure RDBMS realms.
- Select the Notes tab in the right pane. This will display
instructions for enabling this realm in your environment.
- After following the steps in the Notes field, click Apply.
- Click to expand the Caching Realms node in the left pane.
- Select defaultCachingRealm in the left pane.
- Select the RDBMS realm that you had previously configured and click Apply.
Run the Example
- Restart the server.
- Bring up the
Administration Console in a browser.
- Click to expand the Security node in the left-hand pane.
- Select the User, Group, and Access Control Lists nodes and view the addition
security information defined by the RDBMS security realm.
There's More...
Read more about security realms in Programming WebLogic Security and in Managing Security.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.