4.4.2 ステップ2: CORBAクライアント・アプリケーションの記述
次の処理を実行するクライアント・アプリケーション・コードを記述します:
- Bootstrapオブジェクトを使用し、指定したOracle TuxedoドメインでSecurityCurrentオブジェクトのリファレンスを取得します。
- SecurityCurrentオブジェクトからPrincipalAuthenticatorオブジェクトを取得します。
- PrincipalAuthenticatorオブジェクトの
get_auth_type()操作を使用して、Oracle Tuxedoドメインが想定するタイプの認証を返します。
次のコード・スニペットは、Securityサンプル・アプリケーションのCORBA C++クライアント・アプリケーションの一部分であり、セキュリティの開発ステップを示しています。
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);親トピック: 開発ステップ