Authentication.java

Abstract This example demonstrates how the Authentication Exit of the Administration Server can be used.
This example shows ...
  • How to evaluate the parameters that are passed to the authentication exit.
  • How to use X509 certificates or user-defined credentials for authentication.
  • How to signal the authentication results to the Administration Server.
You can use this example to ...
  • Implement your own authentication exit by replacing the implementation of Authenticate().
Minimum MQWF version required
  • V3.3.0
Preparations for the execution of the sample
    1. To set up the Administration Server for the Java Authentication Exit, the Authentication.class file must be in the sever's CLASSPATH. Do this by adding the fmctoaut.jar file to the Administration Server's CLASSPATH. It is located in the /smp/java/exit/ directory.
    2. To enable the Authentication Exit, see the Programming Guide and use the following command:
      fmczchk -c inst:m,RTAuthenticationExitTypeServer,java
      If the Administration Server is already running, shut down the server and restart it for the changes to take effect.
    3. To use the AuthenticationClient, generate your own X509 certificate. This helps to avoid problems concerning the validity of the certificate. The generation of X509 certificates can be done using the keytool utility of jdk 1.2.2. The following example shows how to create an X509 certifcate for the Administrator user.
      1. Generate Key pair for the user:

        >keytool -genkey -alias admin
        Enter keystore password:
        What is your first and last name?
        [Unknown]: Administrator
        What is the name of your organizational unit?
        [Unknown]: AdminUnit
        What is the name of your organization?
        [Unknown]: AdminOrg
        What is the name of your City or Locality?
        [Unknown]: AdminCity
        What is the name of your State or Province?
        [Unknown]: AdminState
        What is the two-letter country code for this unit?
        [Unknown]: DE
        Is correct?
        [no]: y
        Enter key password for
        (RETURN if same as keystore password):

      2. Export an X509 certificate for the user with alias admin out of the keystore:
        >keytool -export -alias admin -file AdminCert.cert

      The AuthenticationClient tries to load an X509 certificate stored in the file AdminCert.cert. If you have other certificate files you can pass their names as an argument to the AuthenticationClient. Note, however, that the sample implementation of the Authentication Exit only recognizes a small number of user names (see Authentication.java for details)!
    4. To test the java authentication exit, you can use the AuthenticationClient. Start it by typing:
      java com.ibm.workflow.java.exit.sample.AuthenticationClient [filename of certificate]
View source code  Authentication.java


[ Back to Java index ]