The Shibboleth IdP V3 software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only. See the IDP4 wiki space for current documentation on the supported version.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The <AttributeFilterScript> element contains a script (or a reference to a script) that implements Predicate<Attribute>.

Software version requirement

This feature requires IdP V3.4 or later.

The <AttributeFilterScript> element implicitly iterates over all entity attributes in the input. For each entity attribute, if the predicate evaluates to false, the entity attribute is removed from the input stream.

Schema

The <AttributeFilterScript> element is a configuration element of type ScriptType. Both the element and its type are defined by the urn:mace:shibboleth:2.0:metadata schema, which can be located at http://shibboleth.net/schema/idp/shibboleth-metadata.xsd.

The following sections describe the attributes and elements of the ScriptType type.

Unable to render {include} The included page could not be found.

Examples

The following examples assume the default JavaScript language.

Typically the script operates on a single input parameter as follows:

A boolean function of one parameter
<AttributeFilterScript>
    <Script>
    <![CDATA[
        // an implementation of Predicate<Attribute>
        // applied to the input argument
        //
        // the input argument is of type:
        // org.opensaml.saml.saml2.core.Attribute
        //
        (function (attribute) {
            "use strict";

            // do not remove the entity attribute
            if (attribute === null) { return true; }

            // implement the predicate here...
        }(input));
    ]]>
    </Script>
</AttributeFilterScript>

The actual input argument is an instance of a class that implements the Attribute interface. The formal parameter name is arbitrary. In the previous example, the name attribute is used for clarity.

  • No labels