Previous Topic: Extend the SAML and WS-Federation Authentication SchemesNext Topic: Customizing a SAML Assertion


Use the Authorization API

The Java Authorization API lets you implement custom functionality for controlling access to protected resources.

The functionality is provided through custom Java classes that are referenced in Policy Server active expressions. An active expression is a string of variable definitions that appears in the following Policy Server objects:

Active Expressions

Active expressions are constructed in the Policy Server User Interface using the following syntax:

<@ lib=<lib-spec> func=<func-spec> param=<func-params>@>

An active expression based on the Java Authorization API has the following required fields:

You define an active expression when you configure the active policy, rule, or response in the Policy Server User Interface.

Execute an Active Expression

When SiteMinder detects an active expression that references a custom Java class, it performs the following tasks:

Interpret an Active Expression Result

SiteMinder interprets the result returned by the instance of the custom Java class according to the type of active expression that references the Java class, as follows:

ActiveExpression Methods

The base interface in the Java Authorization API is ActiveExpression. All Java classes that provide custom authorization functionality must implement this interface.

The name of the class that you implement from the base interface must appear in the param field of any associated active expression.

SiteMinder calls the following methods in the base interface ActiveExpression:

Method

Description

init()

Performs any initialization procedures that the custom Java class requires. SiteMinder calls this method once per instance of the custom ActiveExpression class.

invoke()

Performs the custom authorization functionality in the ActiveExpression object and returns a result.

release()

Performs any rundown procedures that the ActiveExpression object requires. SiteMinder calls this method once for each instance of an ActiveExpression class, when SiteMinder is shutting down.

Note: Classes that implement ActiveExpression should be implemented on a stateless model that does not depend on instance state stored in member variables of the ActiveExpression class.

Other Classes in the Authorization API

The following classes in the Authorization API are used in conjunction with the ActiveExpression base interface:

Class

Description

ActiveExpressionContext

Contains the following context classes passed to invoke():

  • APIContext
  • RequestContext
  • UserContext

RequestContext

Provides information about the user’s access request—for example, the server or resource portion of the request.

Modify a SAML Assertion or Response

According to SAML specifications, an assertion (SAML 1.x) or response (SAML 2.0) is generated by a producer site and sent to a consumer site for validation. Typically, you will use the default SAML assertion or response that SiteMinder generates at the producer site. If you want to modify the content of the assertion or the reponse, you can do so by implementing the Java assertion generator plug-in. This plug-in is appropriate for both consumers (SAML 1.x) and Service Providers (SAML 2.0).

To modify the SAML assertion or response

  1. Implement a Java SAML assertion generator plug-in.

    The implementation is a plug-in for the SiteMinder Assertion Generator Framework. The Assertion Generator Framework sends a default token to the custom plug-in object. After processing, the custom object passes a modified token to the Assertion Generator Framework.

  2. Configure the plug-in by specifying the fully-qualified name of the plug-in class and any optional parameters that the plug-in might require.

    You configure a custom assertion generator plug-in in any of these ways:

    Note: Configuration of the assertion generator plug-in requires a Policy Management API session version of at least v6.0 SP 2.

Interaction between SiteMinder and an Assertion Generator

The following steps outline the interaction between SiteMinder and a custom assertion generator plug-in. The activities begin when an authorized user makes a request, through a SiteMinder Policy Server, for a resource at a site that consumes assertions:

  1. An authorized user requires a SAML assertion or response for a consumer or Service Provider.
  2. The SiteMinder Assertion Generator Framework generates a default SAML assertion or response.
  3. If an assertion generator plug-in is defined for the site that consumes the assertion, the SiteMinder Assertion Generator Framework requests an instance of the plug-in object from the plug-in cache.

    Note: The site consuming assertions can have no more than one assertion generator plug-in defined for it.

  4. If the plug-in has not yet been loaded into cache:
    1. SiteMinder instantiates the plug-in class and loads it into cache.
    2. SiteMinder calls the plug-in’s init() method. This method performs any initialization procedures that you have implemented for the plug-in.

    A successfully initialized plug-in object remains in cache until SiteMinder shuts down. This avoids having to re-load and re-initialize the object every time the plug-in is required.

  5. The SiteMinder Assertion Generator Framework passes the default XML token, generated in step 2, to the plug-in’s customizeAssertion() method.
  6. The plug-in validates or modifies the information as required, and returns the processed assertion to the Assertion Generator Framework.
  7. The Assertion Generator Framework passes the processed token to the consumer or Service Provider. This site uses the information in the assertion to determine how to respond to the user’s request.
  8. Steps through are repeated whenever a user requires an assertion for the service provider.

When SiteMinder is about to shut down, SiteMinder calls the plug-in’s release() method to allow the plug-in to perform any rundown activities it might require.

Development and Deployment Notes

When developing and deploying a custom assertion generator plug-in, keep the following points in mind: