Weblogic 7 User Manager Adapter | |
Author: Jordan Reed (jreed at sapient.com) Version: Created:
|
| |
|
This module provides adapter classes to allow one to tie Weblogic 7 into
the Carbon User Manager service. This allows one to protect Weblogic resources
such as Servlets, JSPs, EJBs, Data sources, etc., using a standardized User Management
service that can also be used by the application for managing users.
|
|
This module is needed by anyone using a Weblogic 7 release that is using a
user store which is not one natively supported by Weblogic. This will allow
one to tie Weblogic directly into the security service and allow full use of
the J2EE security model.
|
|
- Weblogic 7
- Any dependencies used by the User Manager implementation.
|
|
| |
- Install Carbon to the main Application Server Classpath
- Install/Configure the Carbon Security Realm MBean for Weblogic
- Setup the Weblogic Deployment Descriptors for the J2EE application
This will describe the process of setting up Carbon using the Weblogic
console. At the end of this documentation is the snippet from the
config.xml created by Weblogic after these steps are completed.
|
The classes used here, and all dependencies must be installed into
Weblogic's root classpath. This means one must edit the
startWeblogic file for the environment to properly
setup the classpath and any other Carbon deployment properties.
This allows Carbon, and including the User Manager service
this depends on, to run within the main application server
sandbox and give proper access to all the needed classes and
memories locations.
The consequence is that only instance of Carbon can run in
the application server. This instance will be initialized
when the application server starts. All applications installed
within the application server context will use the main
applications instance of Carbon. Any deployment properties
set using CarbonDeploymentConfig.properties inside
and application specific classpath (the EAR, WAR or JAR)
will not be used.
|
|
To use the Weblogic Security Adapter along with Weblogic's MBeanServer
requires some special Carbon configuration. Because the JMX assistant
will attempt to make a JNDI connection to Weblogic, Weblogic will
attempt to validate this connection with the security service. This
can easily cause cycles in startup that will break the Carbon startup
process.
Example
- Startup service begins.
- Startup Component has JMX Assistant
- JMX Assistant attempts JNDI connection to Weblogic
- Weblogic calls to authentication provides (including Carbon Security)
-
Carbon security attempts to bootstrap, but is missing components it
depends on (DeploymentService, ConfigurationTypeService, etc).
- Carbon fails to load
The solution is to have a second, separate ComponentTemplate, that does
not contain the JMX assistant. All components the Security Service is
dependent on must use the non-JMX ComponentTemplate. This will include the
DeploymentService, ConfigurationTypeService and any components in the
UserManagerService (such as the ConnectionFactory and StatementFactory for
the RDBMS implementation).
This does not remove the ability to JMX administer the security service.
Simply add a UserManagerJmxAdapter which uses the default component
template with JMX. Make sure this service initializes AFTER
the User Manager service has started.
|
|
To setup the Carbon User Manager requires defining a new custom
security realm is referenced by the J2EE application. Weblogic
provides complete instructions on the generic process
available from their online help at:
Configuring a WebLogic Authentication Provider
|
|
After starting the application server the custom realm must be
configured. This tells Weblogic which classes are used to
work with the realm. The following steps are done in the
Weblogic console, usually accessible at
http://localhost:7001/console
-
Before starting Weblogic, copy the "carbon-security-weblogic7.jar" file to the
Weblogic MBean directory, (e.g. d:\bea\weblogic700\server\lib\mbeantypes).
- In the left, go to [domain name]->Security->Realms->[realm name]->Providers->Authentication Providers
- Click "Configure a new Weblogic Carbon Authenticator..."
- Give the Authenticator a name. This example uses
WeblogicCarbonAuthenticator
- Click the "Create" button
-
Update the control flag if needed. It it suggested to switch the control to
"SUFFICIENT". This will allow the Weblogic file system to continue to
authenticate the "system" account without passing the Carbon authentication.
-
Switch the "DefaultAuthenticator" and update the Control Flag appropriately.
It is suggested to switch the control to "SUFFICIENT". This will allow the Weblogic
file system to continue to authenticate the "system" account, but will also
allow the new Carbon Authenticator to work independently.
- Reboot Weblogic
-
Update the location of the UserManager service using a JMX tool. To use Weblogic's
enter:
Java weblogic.Admin -username system -password administrator SET -mbean Security:Name=myrealmWeblogicCarbonAuthenticator -property UserManagerLocation /new/location .
IMPORTANT: Weblogic's Admin tool has a bug in it which often keeps it from
updating user created MBeans. If an error is given, it will require the use of
a third party tool like MC4J to update
the value.
|
|
|