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 5 Next »

Various custom configuration elements support a common content model used to supply JSR-223 scripts inside other object configurations. Where applicable, the specific configuration elements that share this content model will link to this page. These include the following documentation pages:

This feature is new in V3.4 and is a supplement to the older supported approach of defining scripted beans in native Spring files and referring to the beans by reference.

Namespace and Schema

Configuration elements that contain scripts are of type ScriptType, which is a type used across a number of namespaces. The specific namespace will depend on where the element shows up in your configuration.

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

Attributes

An element of type ScriptType has the following XML attributes:

Name

Type

Use

Default

Description

language          
stringoptional"javascript"Defines the JSR-223 language to use. The default is ECMAScript using either the Rhino (Java 7) or Nashorn (Java 8) engines.

customObjectRef 3.2

stringoptional
The ID of a Spring bean defined elsewhere in the configuration.

If the customObjectRef attribute is present, the result of the referenced Spring bean is made available to the script in a variable named custom. This is in addition to whatever input context is routinely made available to the script. For details, consult the individual configuration element pages listed above.

Child Elements

An element of type ScriptType has the following child elements:

NameCardinalityDescription
<Script>


Exactly One

An inline script
<ScriptFile>
Path to a local file or classpath resource containing the script

Wrap inline scripts with an XML CDATA block

An inline script is usually wrapped inside an XML CDATA block to protect against special XML characters. For example:

<Script>
<![CDATA[
    // script goes here
]]>
</Script>

All inline scripts should be wrapped this way, even simple scripts.

For specific examples of scripts, consult the individual configuration element pages listed above.

  • No labels