Sun Java System Access Manager 7 2005Q4 Developer's Guide

Java API Code Samples and Their Locations

The following tables describe the locations of all the files you need to implement the sample programs on various platforms, and the variable names used for default directories in the source code and Makefiles. Table 5–2 summarizes file locations and variable names used for Solaris Sparc/x86.l Table 5–3 summarizes default directories for Linux. Table 5–4 summarizes default directories for Windows 2000.

Table 5–2 Default directories for Solaris Sparc/x86

Variable 

Description 

Location 

Api_sample_dir

Directory that contains authentication API sample files 

<install_root>/SUNWam/
	samples/authenitcation/api

Config_directory

Directory that contains configuration files 

/etc/opt/SUNWam/config

Product_Directory

Directory where Access Manager is installed. 

install_root>/SUNWam

Table 5–3 Default directories for Linux

Variable 

Description 

Location 

Api_Sample_Dir

Directory that contains authentication API sample files 

<install_root>/sun/
	identity/samples/authentication/api

Config_Directory

Directory that contains configuration files 

/etc/opt/sun/identity/config

Product_Directory

Directory where Access Manager is installed. 

<install_root>/sun/identity

Table 5–4 Default directories for Windows 2000

Variable 

Description 

Location 

Api_Sample_Dir

Directory that contains authentication API sample files 

<install_root>\samples\
	authentication\api

Config_Directory

Directory that contains configuration files 

<install_root>\lib

Product_Directory

Directory where Access Manager is installed. 

<install_root>

These steps are for all platforms.

ProcedureTo Compile and Execute the Java API Samples

  1. In the Makefile, modify the following variables as necessary to suit your Access Manager installation:

    BASE_DIR: Enter the path to the directory where Access Manager is installed.

    JAVA_HOME: Enter the path to the directory where the Java compiler is installed.

    DOMAIN: Enter the name of the organization to login to.

    SHARE_LIB: Enter the path to the directory where Access Manager jar files are stored.

    JSS_JAR_PATH: Enter the path to the directory where JSS jar files are stored.

    JSSPATH: Enter the path to the directory where JSS libraries are located.

  2. In the Certificate Sample Makefile only, modify the following as necessary:

    CERTNICKNAME: Enter the Certificate nickname.

    URL: Enter the Access Manger Server URL.

    PASSWORD: Enter the Certificate DB Password.

  3. Copy AMConfig.properties from Config_Directory in the Access Manager server installation to the client machine.

    (Note: For SSL check SSL Configuration Setup, step 2).

  4. In the Makefile, update the classpath to include the location of the newly created AMConfig.properties.

  5. In the client machine, create a directory named locale.

    C opy all the property files from the locale directory in the Access Manager server installation machine to the client machine. The locale directory on the server machine can be found under the Product_Directory.

  6. Update the classpath in the Makefile to include the location of newly created locale files.

  7. Include jaas.jar in your classpath if you are using a JDK version less than JDK1.4

  8. Compile the program.

    • On Solaris Sparc/x86, Linux, run the gmake command.

      • On Windows 2000, run the make command.

  9. Run the sample program.

    • On Solaris Sparc/x86 or Linux, run the following command: gmake run

      • On Windows 2000, run the following command: make run

ProcedureTo Configure SSL for Java API Samples

  1. In the Makefile, add this JVM property in the run target:

    -D "java.protocol.handler.pkgs=com.iplanet.services.comm"

  2. Copy AMConfig.properties from Config_Directory in the Access Manager server installation to the client machine.

  3. Edit the following properties in AMConfig.properties.

    com.iplanet.am.admin.cli.certdb.dir: Enter the path to the certificate database directory.

    com.iplanet.am.admin.cli.certdb.prefix: Enter the certificate database prefix.

  4. In the LDAP and JCDI Samples only:

    com.iplanet.am.server.protocol: Change the value to HTTPS.

    com.iplanet.am.server.port: Enter the appropriate port number from the server machine.

  5. Create or copy the certificate database file to the certificate db directory. Use the directory name in com.iplanet.am.admin.cli.certdb.dir.

  6. Rename the file to use the prefix specified in the property com.iplanet.am.admin.cli.certdb.prefix.

    For the details, see the Javadoc for the Remote Client API.