Sun OpenSSO Enterprise 8.0 Developer's Guide

ProcedureTo Run the Client SDK Command Line Samples

This procedure documents compiling the command line samples as well as running them. It uses the scripts for the Solaris and Linux operating systems. opensso-client-zip-root refers to the directory in which you decompressed the appropriate Client SDK WAR.


Caution – Caution –

Be sure to run all the scripts discussed one level up from the directory in which they are found.


Before You Begin

This procedure assumes you have completed To Install the Client SDK by Deploying the Sample WAR and the successful configuration screen is still displayed.

  1. On the command line of the machine on which the Client SDK is installed, change to opensso-client-zip-root/sdk/scripts and run chmod to make the scripts executable.


    # cd opensso-client-zip-root/sdk/scripts
    # chmod 755 *.sh
    
  2. Execute compile-samples.sh to compile the scripts.


    # cd ../
    # scripts/compile-samples.sh
    
  3. Run the setup script to initialize the command line samples.


    # cd ../
    # scripts/setup.sh
    

    Note –

    Use setup.bat on Windows systems.


    The script uses Main.java and creates AMConfig.properties with a pointer to the opensso-client-zip-root/sdk/resources directory.

  4. Run the individual Client SDK samples by executing the rest of the scripts in the /scripts directory.

    Login.sh/Login.bat

    Uses Login.java to log in and log out a user.

    CommandLineSSO.sh/CommandLineSSO.bat

    Uses CommandLineSSO.java to retrieve a user profile.

    CommandLineIdrepo.sh/CommandLineIdrepo.bat

    Uses its myriad source files to perform operations on the identity data store. For example, create an identity, delete an identity, and search or select an identity.

    CommandLineLogging.sh/CommandLineLogging.bat

    Uses its myriad source files (including LogSample.java) to demonstrate the login process and write a log record of a successful authentication. You will need to authenticate two identities: the subject of the LogRecord and the logger (amadmin).

    SSOTokenSample.sh/SSOTokenSample.bat

    to verify an SSOToken. Uses SSOTokenSample.java to demonstrate this and other functions of the session API.


    Note –

    Before running this sample, you will need an SSO Token ID. You can get this by running the Service Configuration Sample in To Run the Client SDK Web-based Samples and copying the ID that is displayed.


    run-policy-evaluation-sample.sh/run-policy-evaluation-sample.bat

    Returns a policy decision based on console created user and configured policy. Uses the code sourced in the policy directory on opensso.dev.jave.net.

    run-xacml-client-sample.sh/run-xacml-client-sample.bat

    Uses XACMLClientSample.java to construct a XACML request, to make an authorization query, receive the decision, and print out the response.


    Note –

    At run time, a sample might require additional property files to be setup in the /resources directory. Check the comments included in each individual script for more information.