Sun Java System Access Manager 7.1 Developer's Guide

ProcedureTo Run a Sample Program from the Access Manager Server

  1. Set the environment variables.

    The following environment variables are used to run the make command. You can also set these variables in the Makefile which is in the same directory as the sample files.


    Specify the directory where the Access Manager Server is installed.


    Specify the directory where all the .JAR files are installed. Example: AccessManager-base/SUNWam/lib


    Specify the JDK version your are using. The version must be JDK 1.3.1 or higher.


    Specify the directory where you will keep the sample compiled classes.


    Specify the directory where the .JAR of the sample classes will be created. The default is the current directory.

  2. In the directory AccessManager-base/SUNWam/samples/sso, run the gmake command.

  3. From the directory JAR_DIR, copy the file SSOSample.jar to the directory AccessManager-base/SUNWam/lib.

  4. Update the web container classpath.

    1. Create a web server admin password file.

      echo "wadm_password=<WS_ADMINPASSWD>" > /tmp/ws70adminpasswd
    2. Use wadm get-jvm-prop to retrieve the current classpath for the Web Server instance.

      ORIGCLASSPATH=`$WADM get-jvm-prop --user=$WS_ADMIN 
      --password-file=/tmp/ws70adminpasswd--host=$WS_HOST --port=$WS_ADMINPORT 
      --config=$WS_CONFIG class-path-suffix`
    3. Use wadm set-jvm-prop to add the SSOSample.jar to the Web Server instance's classpath.

      $WADM set-jvm-prop --user=$WS_ADMIN --password-file=/tmp/ws70adminpasswd 
      --host=$WS_HOST --port=$WS_ADMINPORT --config=$WS_CONFIG class-path-suffix=
  5. Register the Sample servlet.

    1. In the file WebContainer-base/https-host.domain/web-app/SERVICES_DEPLOY_URI/WEB-INF/web.xml, insert the following lines immediately after the last </servlet> tag:

    2. Insert the following lines immediately after the last </servlet-mapping> tag.

  6. Restart the Access Manager server.

  7. Log in to the Access Manager console.

    To execute SSOTokenSampleServlet, you must be authorized to access that resource. If you do not have authorization, the request will be denied. See the instructions for setting policy in the Administration Guide.

  8. Use a browser to access the following URL:


    The default value of SERVICES-DEPLOY-URI is amserver.

    The host name must be a fully qualified name. Your sample program should display the output in the browser.