13.07.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Running the client-side login sampleTo test the client-side login scenario, launch the ITSOBank J2EE clientapplication from the command line. The client is packaged with all the applicationmodules in the enterprise archive. Normally, you will only need the clientapplication, the utility JARs, and some of the EJB classes for client access.launchclient itsobank_secured.ear [ stdin | gui | username password realm ]The following example launches the client using the character-based console tocollect login information:launchclient itsobank_secured.ear stdinThe following example launches the client passing the login information asparameters:launchclient itsobank_secured.ear manager01 password dirsrv:389If you are running the client from a remote terminal, you have to specify theserver hostname and eventually the server port for the connection:launchclient -CCBootstrapHost=appsrv01 -CCBootstrapPort=2809itsobank_secured.earThin Java applicationThe thin Java application also has to use a login mechanism to log in to theapplication server. <strong>WebSphere</strong> Application Server V5 supports JAAS as theauthentication mechanism for programmatic login. In order to perform a login toaccess a remote EJB, you must do the following:1. Initialize the ORB for the CORBA connection. The following code snippetshows the ORB initialization.Example 8-8 ORB initialization...Properties props = new Properties();props.put("org.omg.CORBA.ORBClass", "com.ibm.CORBA.iiop.ORB");props.put("com.ibm.CORBA.ORBInitRef.NameService","corbaloc:iiop:" + serverName+ ":" + serverPort + "/NameService");props.put("com.ibm.CORBA.ORBInitRef.NameServiceServerRoot","corbaloc:iiop:"+serverName + ":" + serverPort + "/NameServiceServerRoot");ORB _orb = ORB.init((String[]) null, props);...2. Perform the programmatic login using JAAS; this part is very similar to thelogin process introduced before.3. Initialize the Context for the EJB lookup, then look up the EJB.4. Acquire the remote object through the EJB’s home interface.Chapter 8. Programmatic security 211

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!