In many circumstances you need programmatic control of the IBM i authentication process, for example in single sign on situations. Please follow these basic steps for to implement.

Note that this method will work for both standard WebClient and for WebClient Mobile applications

1. Create a Plex function to accept your User Id and Password. You can create a panel for the user to enter in this information.

2. Add variables to the Local context:

  • IBMi Connection Property
  • Property Value
  • Return Value

3. Add Java source to authenticate the user to the IBMi


	   try {
			&(4:).set(new ObCharFld("   "));
			AS400 myas400 = new AS400(&(1:).getValue());        
	   	catch (AS400SecurityException i) {
			&(4:).set(new ObCharFld("INF"));
		catch (Exception e){
			&(4:).set(new ObCharFld("ERR"));

4. Once the user has been authenticated to the AS400, Java API calls are used to complete the process.


5. Make sure the file is located within the Java project in WebClient.


6. Obtain jt400.jar (Supplied by IBM) and add to your build path / deployment assembly in Eclipse. Compile and run the process.

First add to Java Project and add to build path

Copy and paste the jt400.jar file into the root of the Java project. Then right click and choose the build path option, libraries tab. Choose add JAR’s button.

Then add to Deployment Assembly in the Web project

Right click on the Web project. Select Properties, and select Deployment Assembly. Choose “Archives from Workspace”, then add the jar from the java project.




Note: This process is very similar to a standard Plex login to the IBMi. In client-server CA Plex apps each user has their own local copy of The difference here is that WebClient maintains a user copy of the file in the session.  So that the login is maintained for a specific user for a specific session

Contributed by Mark Schroeder. Mark can be reached at