BEA Logo BEA WebLogic Enterprise Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLE Doc Home   |   Getting Started   |   Previous   |   Next   |   Contents   |   Index

Using Security

This topic includes the following sections:

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++ and Java topics in Reference in the WebLogic Enterprise online documentation.

How Security Works

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

Figure 5-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 username/password authentication. 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 5-2 illustrates the Security sample application.

Figure 5-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 Using Security in the WebLogic Enterprise online documentation.

Development Steps

Table 5-1 lists the development steps for writing a WLE CORBA application that has username/password authentication security.

Table 5-1 Development Steps for WLE CORBA Applications That Have Security

Step

Description

1

Define the security level in the configuration file.

2

Write the CORBA client application.

Step 1: Define the security level in the configuration file.

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

Table 5-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 CORBA application, see Using Security in the WebLogic Enterprise online documentation.

Step 2: Write the CORBA 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 5-1 and Listing 5-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.

Listing 5-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_ref->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 5-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);