BEA WebLogic Enterprise 4.2    Developer Center     

        HOME   |   SITE MAP   |   SEARCH   |   CONTACT   |   GLOSSARY  |   PDF FILES |   WHAT'S NEW 
 
        GETTING STARTED    |   TABLE OF CONTENTS   |   PREVIOUS TOPIC   |   NEXT TOPIC   |   INDEX 

Using Security


This chapter discusses the following topics:

Overview of the Security Service

The WLE product offers a security model based on the CORBAservices Security Service. The WLE security model implements the authentication portion of the CORBAservices Security Service.

Security information is defined on a domain basis. The security level for the domain is defined in the configuration file. Client applications use the SecurityCurrent object to provide the necessary authentication information to log on to the WLE domain.

The following levels of authentication are provided:

In the WLE software, only the PrincipalAuthenticator and Credentials properties on the SecurityCurrent object are supported. For a description of the SecurityLevel1::Current and SecurityLevel2::Current interfaces, see the C++ Programming Reference or the Java Programming Reference on the Online Documentation CD.

How Security Works

Figure 3-1 illustrates how security works in a WLE domain.

Figure 3-1 How Security Works in a WLE Domain

The steps are as follows:

  1. The client application uses the Bootstrap object to return an object reference to the SecurityCurrent object for the WLE domain.

  2. The client application obtains the PrincipalAuthenticator.

  3. The client application uses the Tobj::PrincipalAuthenticator::get_auth_type() method to get the authentication level for the WLE domain.

  4. The proper authentication level is returned to the client application.

  5. The client application uses the Tobj::PrincipalAuthenticator::logon() method to log on to the WLE domain with the proper authentication information.

The Security Sample Application

The Security sample application demonstrates application-level security. The Security sample application requires each student using the application to have an ID and a password. The Security sample application works in the following manner:

Figure 3-2 illustrates the Security sample application.

Figure 3-2 Security Sample Application

The source files for the Security sample application are located in the \samples\corba\university directory in the WLE software. For information about building and running the Security sample application, see the Guide to the University Sample Applications on the Online Documentation CD.

Development Steps

Table 3-1 lists the development steps for writing a WLE application that has security.

Table 3-1 Development Steps for WLE Applications That Have Security

Step Description

1

Define the security level in the configuration file.

2

Write the client application.

Step 1: Defining the Security Level in the Configuration File

The security level for a WLE domain is defined by setting the SECURITY parameter RESOURSES section of the configuration file to the desired security level. Table 3-2 lists the options for the SECURITY parameter.

Table 3-2 Options for the SECURITY Parameter

Option Definition

NONE

No security is implemented in the domain. This option is the default. This option maps to the TOBJ_NOAUTH level of authentication.

APP_PW

Requires that client applications provide an application password during initialization. The tmloadcf command prompts for an application password. This option maps to the TOBJ_APPAUTH level of authentication.

USER_AUTH

Requires an application password and performs a per-user authentication during the initialization of the client application. This option maps to the TOBJ_SYSAUTH level of authentication.

In the Security sample application, the SECURITY parameter is set to APP_PW for application-level security. For information about adding security to a WLE domain, see the Administration Guide on the Online Documentation CD.

Step 2: Writing the Client Application

Write client application code that does the following:

  1. Uses the Bootstrap object to obtain a reference to the SecurityCurrent object for the specific WLE domain.

  2. Gets the PrincipalAuthenticator object from the SecurityCurrent object.

  3. Uses the get_auth_type operation of the PrincipalAuthenticator object to return the type of authentication expected by the WLE domain.

Listing 3-1 and Listing 3-2 include the portions of the CORBA C++ and CORBA Java client applications in the Security sample application that illustrate the development steps for security. To see an example of the code for ActiveX client applications, see the Guide to the University Sample Applications on the Online Documentation CD.

Listing 3-1 Example of Security in a CORBA C++ Client Application
CORBA::Object_var var_security_current_oref =   
bootstrap.resolve_initial_references("SecurityCurrent");
SecurityLevel2::Current_var var_security_current_ref =
SecurityLevel2::Current::_narrow(var_security_current_oref.in());
//Get the PrincipalAuthenticator
SecurityLevel2::PrincipalAuthenticator_var var_principal_authenticator_oref =
var_security_current_oref->principal_authenticator();
//Narrow the PrincipalAuthenticator
Tobj::PrincipalAuthenticator_var var_bea_principal_authenticator =
Tobj::PrincipalAuthenticator::_narrow
var_principal_authenticator_oref.in());
//Determine the security level
Tobj::AuthType auth_type = var_bea_principal_authenticator->get_auth_type();
Security::AuthenticationStatus status = var_bea_principalauthenticator->logon(
user_name,
client_name,
system_password,
user_password,
0);

Listing 3-2 Example of Security in a CORBA Java Client Application
org.omg.CORBA.Object SecurityCurrentObj = 
gBootstrapObjRef.resolve_initial_references("SecurityCurrent");
org.omg.SecurityLevel2.Current secCur =
org.omg.SecurityLevel2.CurrentHelper.narrow(secCurObj);
//Get the PrincipalAuthenticator
org.omg.SecurityLevel2.PrincipalAuthenticator authlevel2 =
secCur.principal_authenticator();
//Narrow the PrincipalAuthenticator
com.beasys.Tobj.PrincipalAuthenticatorObjRef gPrinAuthObjRef =
(com.beasys.Tobj.PrincipalAuthenticator)
org.omg.SecurityLevel2.PrincipalAuthenticatorHelper.narrow(authlevel2);
//Determine the security level
com.beasys.Tobj.Authtype authType = gPrinAuthObjRef.get_auth_type();
org.omg.Security.AuthenticationStatus status = gPrinAuthObjRef.logon
(gUserName, ClientName, gSystemPassword, gUserPassword,0);


Copyright © 1999 BEA Systems, Inc. All Rights Reserved.
Required browser version: Netscape Communicator version 4.0 or higher, or Microsoft Internet Explorer version 4.0 or higher.
Last update: July 06, 1999.