Example: Running the non-JAAS sample

To run a sample, you need to download and modify the sample source code. For more information, see Downloading and running the sample programs.

Starting the primary server

Use the following command to start a non-JAAS server that listens on port 4444. The server runs as the principal (superSecureServer) and uses a secondary server (backupServer). The server also displays application and credential debugging information.

     java -classpath ibmjgsssample.jar
          -Dcom.ibm.security.jgss.debug="app, cred"
          com.ibm.security.jgss.test.Server -p 4444
          -n superSecureServer -s backupServer

Successfully running this example displays the following message:

     listening on port 4444

Starting the secondary server

Use the following command to start a non-JAAS secondary server that listens on port 3333 and runs as principal backupServer:

     java -classpath ibmjgsssample.jar
          com.ibm.security.jgss.test.Server -p 3333
          -n backupServer

Starting the client

Use the following command (typed on a single line) to run JAAS-enabled client (myClient). The client communicates with the primary server on the host (securityCentral). The client runs with the default security manager enabled, uses the JAAS configuration and policy files and the Java™ policy file from the config directory. For more information about the config directory, see Downloading the IBM® JGSS samples.

     java -classpath ibmjgsssample.jar
          -Djava.security.manager
          -Djava.security.auth.login.config=config/jaas.conf
          -Djava.security.policy=config/java.policy
          -Djava.security.auth.policy=config/jaas.policy
          com.ibm.security.jgss.test.JAASClient -n myClient
          -s superSecureServer -h securityCentral:4444