Using the authentication dialog example

The following information describes the use of the example class file, examples.adapters.WESAuthenticationGUIAdapter. This class adds a small user interface to the base WES adapter function.

  1. Follow steps (1) and (2) of the General operation procedures, but substitute 'WESAuthenticationGUIAdapter' for 'WESAuthenticationAdapter' in step (1).
  2. Configure the client's TCP/IP settings as in step (5) of 'General operation'.
Figure 1. WebSphere® Everyplace® Suite adapter user dialog
MQe Suite adapter user login dialog.

The client should now able to send messages to the server using the WESAuthenticationGUIAdapter. This adapter intercepts write calls to the WES adapter, and on the first request it pops up a dialog box that prompts for user ID and password information.

When the user clicks on OK or presses the Enter key, the setBasicAuthorization() method is called with the values from the userid and password fields. The write() is then forwarded on to the underlying WES adapter. The dialog box also has a Cancel button which, when selected, cancels the current write operation by not forwarding the request to the WES adapter. This causes an MQeException (Except_Stopped) to be thrown.

If authentication fails, the dialog box is redisplayed on the next write() along with any information provided by the server. In order to learn of an authentication failure, the example adapter intercepts read() calls and catches any Except_Authenticate MQeExceptions coming from the adapter.

Note: Web browsers do not generally send authentication information on the first flow. This typically results in a 401 or 407 response that contains the realm information. Only then does the browser send the authenticated request. User clients may wish to follow this convention.

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.