Child pages
  • CompositeAttributeDefinition

The Shibboleth 1.x software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only.

Skip to end of metadata
Go to start of metadata

Configuring a Composite Attribute

NOTE: A functional version of this definition has not yet been included in an IdP release but may be retrieved from the source control system if you feel comfortable doing so until is it available in another, easier to install, from.

This attribute definition allows distinct attributes to composed (e.g. concatenated) to form new attributes. For example, the year, course number, and course section may be combined together to produce a course identifier. The actual composition is performed through the Java message format class.

Attribute Definition Basics

All attribute definitions are configured in the IdP's resolver.xml file.

Basic Attributes

Each attribute definition supports the following basic XML attributes in their definition:

  • id - (required) used by the definition to determine its source, or input, attribute and by other definitions and data connectors to refer to this definition
  • sourceName - (optional) used to explicitly specify the name of the source, or input, attribute used by the definition

Source Attributes

Most attribute definitions transform other attributes. A definition will determine the name of its source attribute in the following way:

  1. If sourceName is present use an attribute whose name exactly matches the given source name
  2. Use an attribute whose name exactly matches the definitions id
  3. Use an attribute whose name exactly matches the last token of the definitions id split on / or :

Configuring the Definition

  1. Create a CompositeAttributeDefinition element, with its id attribute, and following attributes:
    • orderedSourceNames - a comma seperated, ordered, list of source attributes to be composed
    • format - the message format string used to compose the attributes

Note that all the source attributes used, if they are multi-value, must contain the same number of values or you will recieved an error when the formatter tries to read a value from an attribute that does not exist.

Example Configuration

<CompositeAttributeDefinition id="course_entitlements"
	<DataConnectorDependency requires="courses"/>

Attribute Definition Dependencies

In order to use attributes from data connectors or other definitions you need to make sure those dependencies are resolved before this definition is called.

If your definition depends on a data connector create a child element, of the main definition element, called DataConnectorDependency and give it an attribute of requires whose value is the id of the data connector this definition depends on.

If your definition depends on another definition create a child element, of the main definition element, called AttributeDependency and give it an attribute of requires whose value is the id of the definition this definition depends on.

Error Propagation

Not every attribute definition may, or need, work for every user in the system. However, the definition may emit an error if it is unable to find any entries for the user or if it depends on another data connector or definition that didn't apply to the current user.

To suppress these errors, so that they don't stop the attribute lookup process, add the follow attribute and value to the main definition element:

  • propagateErrors - with a value of false

Data Caching

Attribute definitions cache their information for the length of one attribute request; until all data connectors and definitions have been evaluated and their information retrieved. You may optionally have the definition cache its data for a fixed period of time. This can increase performance but will result in a lead time for frequently changing data.

To enable this longer-lived cache add the following attribute to the main connector element:

  • cacheTime - the length of time, in seconds, to cache the attributes fetched by this definition
  • No labels