4.4.2 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 Oracle Tuxedo 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 Oracle Tuxedo domain.

The following code snippet includes the portions of the CORBA C++ client applications in the Security sample application that illustrate the development steps for security.

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);