CSIv2 Example

This examples shows how to use the SI&C client side API.

Before starting, please add <jacorb home>/bin to your PATH and <sic home>/examples/csiv2/lib/csiv2-example.jar to your CLASSPATH.

1. Password-based Authentication

Running the Server

Change to <sic home>/examples/csiv2 and start the server by typing:
$> jaco -Dcustom.props=server.props com.prismtech.security.examples.csiv2.Server IOR

The first argument to the server names the file where the server's IOR is written to.

Running the Client

Change to <sic home>/examples/csiv2 and run the client by typing:
$> jaco -Dcustom.props=client.props com.prismtech.security.examples.csiv2.Client IOR AuthenticatedUser prismtech

The first argument to the client names the file where the server's IOR is written to. The second argument is the username and the third is the password to be sent as an CSIv2 AuthenticationToken.

The call to the server should succeed and the client should print the following message:

Successfully called server object

As a variation, run the client with any other password that is not "prismtech". This should yield a org.omg.CORBA.NO_PERMISSION exception.

2. Identity Assertion

The following demonstrates using an identity assertion. The security policy has the user "OtherAuthenticatedUser", but without any permissions. Instead, the user "AssertedUser" has the permission to call the operation on the server, but it has no authentication mechanisms defined. After successfully authenticating "OtherAuthenticatedUser" with the given password, SI&C uses the asserted identity "AssertedUser" received through the CSIv2 layer.

Running the Server

Change to <sic home>/examples/csiv2 and start the server by typing:
$> jaco -Dcustom.props=server.props com.prismtech.security.examples.csiv2.Server IOR

The first argument to the server names the file where the server's IOR is written to.

Running the Client

Change to <sic home>/examples/csiv2 and run the client by typing:
$> jaco -Dcustom.props=client.props com.prismtech.security.examples.csiv2.Client IOR OtherAuthenticatedUser prismtech AssertedUser

The first argument to the client names the file where the server's IOR is written to. The second argument is the username and the third is the password to be sent as an CSIv2 AuthenticationToken. The fourth argument is the asserted identity.

This time, the additional command line argument "AssertedUser" is supplied to the client. This argument is then sent as an identity assertion by the CSIv2 layer. The call to the server should succeed and the client should print the following message:

Successfully called server object