03.05.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.7.1 JAAS in <strong>WebSphere</strong><br />

In the previous version of <strong>WebSphere</strong> Application Server V4.0, other<br />

mechanisms were used to perform programmatic login. There was a distinction<br />

between server-side and client-side programmatic login. One was using the<br />

LoginHelper class together with CORBA authentication methods, while the other<br />

was utilizing the ServerSideAuthenticator class. In <strong>WebSphere</strong> <strong>V5.0</strong> these<br />

classes, together with the mechanism, are deprecated; use the JAAS<br />

programmatic login instead.<br />

With JAAS the client-side and server-side login work in the same way, but the<br />

challenge for authentication works a bit differently. On the client-side, any<br />

challenge mechanism can be used that is compatible with the client’s runtime<br />

environment; while on the server side there is no place to pull up an<br />

authentication challenge window or provide a command line prompt for<br />

username and password. On the server-side, credentials have to be collected in<br />

the code, then provided to the JAAS login facility.<br />

8.7.2 Client-side login with JAAS<br />

Client-side login is useful when the user needs to log in to the security domain on<br />

a remote system using the client application. In this case, the client application<br />

has to collect the login information for authentication purposes. <strong>WebSphere</strong><br />

provides built-in mechanisms to collect the necessary information: user name,<br />

password, realm.<br />

There are two scenarios in this client-side login section, one is an example for<br />

J2EE Java applications, and the other is for thin Java applications. For more<br />

information about Java client security, refer to Chapter 6, “Securing Java clients”<br />

on page 97.<br />

J2EE Java application<br />

The following code snippet shows how to perform various types of login using<br />

character-based console (stdin), graphical user interface, and direct login without<br />

a login prompt.<br />

Example 8-7 Client side login in the ITSOBank J2EE client<br />

...<br />

private static void loginClient() {<br />

LoginContext lc = null;<br />

try {<br />

// using the console (stdin) to collect the login information<br />

if(logintype.equals("stdin")) {<br />

System.out.println("Performing stdin login...");<br />

Chapter 8. Programmatic security 209

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

Saved successfully!

Ooh no, something went wrong!