Sun Java™ System Access Manager provides C application programming interfaces (APIs) that enable external C applications to participate in Access Manager authentication, authorization, single sign-on (SSO), and logging operations. This chapter covers the following topics:
A C header file is a text file that contains pieces of code written in the C programming language. The name of a header file, by convention, ends with the .h extension. It is inserted inside a program by coding the #include preprocessor directive. By default, Access Manager C header files are installed in the /AccessManager-base/SUNWam/include directory. The Access Manager C header files are:
General utility routines provided by the Access Manager library.
Data types and functions for developing custom authentication modules.
Data types and functions for logging on the local system or the Access Manager host.
Data types and functions for creating, destroying, and manipulating the map objects used by Access Manager.
Data types and functions for implementing notifications.
Data types and functions for using Access Manager policy objects.
Data types and functions for property maps used by clients of the Access Manager client APIs.
Data types and functions for implementing SSO.
Data types and functions for manipulating strings.
Common types and macros provided by Access Manager.
This is an unsupported, early access version of utility functions. Functions and data structures may change without backward compatibility.
Data types and functions intended for use by Access Manager web agents.
Access Manager provides code samples that demonstrate how you can use the APIs to connect C applications to the Access Manager framework. By default, the code samples are installed in the /AccessManager-base/SUNWam/samples/csdk directory. The code samples are:
Demonstrates the basic usage of the authentication APIs used to login to an instance of Access Manager.
Demonstrates the basic usage of the logging APIs used to write a message to the Access Manager logs.
Demonstrates the basic usage of the policy APIs used to evaluate access for specified resources.
Before running the sample, be sure the password defined in the property com.sun.am.policy.am.password is in clear text as the sample does not decrypt it. Since am_policy_test.c is only a sample, this poses no security risk. For example:
com.sun.am.policy.am.username = UrlAccessAgent com.sun.am.policy.am.password = clear-text-password
These properties are defined in AMAgent.properties.
Demonstrates the basic usage of the SSO APIs to perform session operations.
Demonstrates how you can use the 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 web agent in a real deployment.
Makefile for building the sample agent.
Provides detailed instructions for building and executing sample programs.
Sample programs are run by launching a generated executable on the command line. The following sections contain instructions for the supported platforms. Be sure to set the library path appropriately for the platform you are using.
Set the LD_LIBRARY_PATH environment variable to include the following:
The /usr/lib directory is included before the /usr/ucblib directory so that common programs (such as editors) will continue to function.
These directories contain the following shared libraries:
Set the LD_LIBRARY_PATH environment variable to include:
This directory contains the following shared libraries:
You must have the /AccessManager-base/SUNWam/lib directory in your path before launching the samples. Alternatively, you can run the run.bat script to launch the samples. The script will set your path appropriately.