Sun Java System Access Manager 7 2005Q4 C API Reference

Chapter 1 About the Access Manager C APIs

This chapter provides information for locating the files you need to use the C APIs. Topics included in this chapter are:

Summary of C Header Files

By default, C header files are installed in the following directory:/AccessManager-base-dir/SUNWam/include

The /include directory contains the following C header files:

am.h

General utility routines provided by the Access Manager library.

am_auth.h

Public functions for developing custom authentication modules.

am_log.h

Public functions for logging on the local system or on the Access Manager server.

am_map.h

Public functions for creating, destroying, and manipulating the map objects used by Access Manager.

am_notify.h

Public function for implementing notifications.

am_policy.h

Public functions for using Access Manager policy objects.

am_properties.h

Properties map used by clients of the Access Manager Client APIs.

am_sso.h

Public functions for implementing Single Sign-on (SSO) in Access Manager.

am_string_set.h

Common types and macros provided by the Access Manager.

am_types.h

Common types and macros provided by Access Manager.

am_utils.h

This is an unsupported, Early Access version of utility functions. Functions and data structures may change without backward compatibility.

am_web.h

Public functions intended for use by only Access Manager web agents.

Summary of C Code Samples

Access Manager provides code samples that demonstrate how you can use the C APIs to connect your C applications to the Access Manager framework. By default, the code samples are installed in the following directory:

/AccessManager-base-dir/SUNWam/samples/csdk

The csdk directory contains the following files:

am_auth_test.c

Demonstrates the basic usage of Authentication SDK APIs you can use to login to an Identity Server.

am_log_test.c

Demonstrates the basic usage of Logging SDK APIs you can use to log a message to the Identity Server logs.

am_policy_test.c

Demonstrates the basic usage of Policy SDK APIs you can use to evaluate policy for specified resources.


Note –

Before running the test, be sure the password for the property com.sun.am.poicy.am.password is in clear text. The sample am_policy_test.c does not decrypt the password before authenticating with Access Manager. Since it is only a sample, when running am_policy_test.c for testing purposes, having the password in clear text poses no security risk. Example:

 
com.sun.am.policy.am.username = UrlAccessAgent
 com.sun.am.policy.am.password = clear-text-password

am_sso_test.c

Demonstrates the basic usage of SSO SDK APIs you can use to perform session operations.

apache_agent.c

Demonstrates how the you can use Policy APIs to build a Web Agent for the Apache Web Server. This is a sample Web Agent and is not intended to serve as a real Web Agent.

Makefile

Makefile for building a sample agent.

README.TXT

Provides detailed instructions for building and executing sample programs.

Required C Libraries

You can run the sample programs by launching the generated executables on the command line. Be sure to set the library path appropriately for the platform you are using.

Solaris Platform

Set the LD_LIBRARY_PATH environment variable to include the following library directories:/usr/lib/mps:/opt/SUNWam/lib:/usr/lib:/usr/ucblib which contain: libamsdk.so, libxml2.so, libssl3.so, libnss3.so, libplc4.so, libplds4.so, libnspr4.so, and libucb.so.

The directory /usr/lib is included before /usr/ucblib so that common programs such as editors will continue to function.

Linux Platform

Set the LD_LIBRARY_PATH environment variable to include the directory:AccessManager-base-dir/agent/libwhich contains: libamsdk.so, libxml2.so,libssl3.so, libnss3.so, libplc4.so, libplds4.so and libnspr4.so.

Windows Platform

You must have the /AccessManager-base-dir/SUNWam/lib directory in your path before launching the sample programs. Alternatively, you can use the run.bat script to launch the sample programs. The script will set your path appropriately.