Authenticate users using i5/OS (AS400) credentials

12-May-2008 | Tags: , , , , , ,
Posted in Security, Tips | No comments

The folks at IBM have a nice API to use i5/OS (AS400) stuff from Java code. Check it out at http://www-03.ibm.com/systems/i/software/toolbox/index.html.

What I particularly find very useful and have used often is to validate user names and passwords with the AS400 authentication services. The following code validates a userName and password.

1
2
3
4
5
6
7
8
9
10
11
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
...
   String ip = "192.168.0.32";  // Place your AS400 IP address here
   String userName = "john"; // User name
   String password = "private"; // Password
   AS400 system = new AS400(ip, userName, password);
   if (system.validateSignon()){
      result = AUTH_OK;
   }
...

Nice and easy, eh?

Bookmark it / share it:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Google
  • Slashdot
  • Technorati
  • YahooMyWeb
  • BlinkList
  • Netvouz
  • StumbleUpon

Tags: , , , , , ,


Post your comment