The examplesDir/legacy/Context directory contains the applications that demonstrate the use of password authentication through the legacy HTTP connector.
Compile all files in this directory with the javac command.
For example, on the Solaris platform with the Korn shell, type:
$ cd examplesDir/legacy/Context/ $ javac -classpath classpath *.java |
Start the agent in a terminal window and specify a list of login-password pairs, as in the following command:
$ java -classpath classpath ContextAgent jack jill billy bob |
Wait for the agent to be completely initialized, then start the manager in another window with the following command:
$ java -classpath classpath ContextClient -ident andy bob |
The client application tries to establish a connection with the login andy and the password bob. The authentication mechanism refuses the connection, and the com.sun.jdmk.comm.UnauthorizedSecurityException is raised by the connector server.
Start the manager again, this time with a valid identity:
$ java -classpath classpath ContextClient -ident jack jill |
The connection is established and the output from management operation is displayed in both windows.
Leave both applications running for the next example.