Previous Topic: Property ClassNext Topic: Connection to a Policy Server


Agent API Guidance for C

This section contains the following topics:

SiteMinder Agents

Agent Type

Agent API Class Hierarchy

Implement the JNI Java Agent API

Implement the Pure Java Agent API

Connection to a Policy Server

User Access to Resources

How Web Agents Use the Agent API

Java Agent API Services

Session Services

Authorization Services

Auditing Services and Transaction Tracking

Management Services

Tunnel Services

Response Attributes

Single Sign-on

Server Clusters

Timeouts

SiteMinder Agents

A SiteMinder Agent is a client of the Agent API. The agent enforces access control policies served by the Policy Server. The Policy Server is a general-purpose policy engine with no specific knowledge of resources. The specific knowledge of resources is provided by SiteMinder agents. Agents establish resource semantics and act as gate keepers to protect resources from unauthorized users.

Different agent types protect different kinds of resources. Some agent types are pre-defined, standard agents that are shipped as part of the SiteMinder product—for example, the Web Agent, which provides HTTP access control for Web Servers. However, you can also use the Agent API to implement custom agents.

The Agent API lets you create a custom agent that can authenticate and authorize users in a variety of context-specific ways. For example, you could create an agent for FTP transfers that does the following:

Custom agents can participate in a single sign-on environment with standard SiteMinder Web Agents.

Agent Type

The Agent Type defines the behavior of an agent. After you have developed a custom agent, you must configure a new Agent Type for the agent in the Policy Server User Interface. For example, if you developed a custom FTP Agent, you would then need to configure an Agent Type for the FTP Agent in the Policy Server User Interface.

Note: For information on configuring an Agent Type for your custom agent, see the SiteMinder Programming Guide for C.

Agent API Class Hierarchy

The primary point of access to the Java Agent API is the AgentAPI class. Several other classes are provided to hold data required by the AgentAPI class:

Implement the JNI Java Agent API

Applications that are built using the JNI Java AgentAPI either directly or indirectly (through another agent) are insulated from underlying implementation details, including:

Additional benefits provided by the Java Agent API include full session management support, automatic encryption key rollover, and real-time policy updates.

To implement the JNI Java Agent API

  1. Review the required software as listed in the accompanying release notes.
  2. Review the sample code.
  3. Write source code for your client application.
  4. Ensure that your system can find the JNI support libraries when the Java Virtual Machine (JVM) is invoked, as follows:

    <install_path>\sdk\bin

    <install_path>/sdk/bin

    <install_path>/sdk/bin

    <install_path>/sdk/bin

    <install_path>/sdk/bin

    Note: The Java Agent API is not available for HP10.

  5. Ensure that SiteMinder can find the JNI Java AgentAPI JAR file when you compile or run an agent that uses the Java Agent API. The JAR file, smjavaagentapi.jar, is stored in the following locations:

    <install_path>\sdk\java

    <install_path>/sdk/java

    Add smjavaagentapi.jar to your CLASSPATH setting. When compiling, you can use the -classpath switch.

  6. Compile the Java Agent API application using javac.

    For an example, see java-build.bat or java-build.sh in the sample directory smjavaagentapi.

  7. Configure the Policy Server to use the Java Agent API application.
  8. Run the application.

    For an example, see java-run.bat or java-run.sh in the sample directory smjavaagentapi.

Implement the Pure Java Agent API

Applications that are built using the pure Java Agent API either directly or indirectly (through another agent) are insulated from underlying implementation details, including:

Additional benefits provided by the Java Agent API include full session management support, automatic encryption key rollover, and real-time policy updates.

To implement the pure Java Agent API

  1. Review the required software as listed in the accompanying release notes.
  2. Review the sample code.
  3. Write source code for your client application.
  4. Ensure that SiteMinder can find the pure Java Agent API .jar file when you compile or run an agent that uses the Java Agent API. The JAR file, smagentapi.jar, is stored in the following locations:

    <install_path>\sdk\java

    <install_path>/sdk/java

    Add smagentapi.jar, crypto.jar, cryptoFIPS.jar to your CLASSPATH setting. When compiling, you can use the -classpath switch.

  5. Compile the Java Agent API application using javac.

    For an example, see java-build.bat or java-build.sh in the sample directory smjavaagentapi.

  6. Configure the Policy Server to use the Java Agent API application.
  7. Run the application.
Pure Java Agent API Usage

Backward compatibility

The pure Java Agent API maintains binary and source compatibility with the JNI Java Agent API. The pure Java Agent API supports all of the other SiteMinder Java SDK interfaces that rely on the Agent API for connectivity to the SiteMinder Policy Server, including the SiteMinder Policy Management API and the SiteMinder DMS API, in addition to extending the portability of those interfaces.

Configuration limitations

The pure Java Agent API does not change the configuration of either the SiteMinder Application Server Agents or any agents developed with the SiteMinder SDK. The configuration of the pure Java Agent API is identical to the configuration of the JNI Java Agent API with the following exceptions:

Enable Pure Java Agent API Tracing

The pure Java Agent API supports detailed trace messages, which are printed to the console. These messages can be useful when running a command line tool that uses the Agent API, such as smreghost.

To enable trace messages, set a system property named enableDebug to "true". From the command line, add -Dcom.ca.siteminder.sdk.agentapi.enableDebug="true". For example:

>SM_SMREGHOST_CLASSPATH="c:\ca\sdk\java\smagentapi.jar;c:\ca\sdk\java\cryptoj.jar"
>java -Dcom.ca.siteminder.sdk.agentapi.enableDebug="true" -classpath %SM_SMREGHOST_CLASSPATH% com.ca.siteminder.sdk.agentapi.SmRegHost -i 127.0.0.1 -hc host_conf1 -hn trustedhost3 -u siteminder -p firewall