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.
ScriptedDataConnector
The ScriptedDataConnector data connector allows the creation of multiple attributes by a JSR-233 script.
When specified in the urn:mace:shibboleth:2.0:resolver:dc namespace, the xsi:type was Script.
Schema Name and Location
This xsi:type is defined by the urn:mace:shibboleth:2.0:resolver schema 3.3, located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd.
Prior to V3.3 supplied plugins were defined by a schema type (xsi:type) in the urn:mace:shibboleth:2.0:resolver:dc namespace, the schema for which is located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver-dc.xsd. This is still supported, but every element or type in the urn:mace:shibboleth:2.0:resolver:dc namespace has an equivalently named (but not necessarily identical) version in the urn:mace:shibboleth:2.0:resolver namespace. The use of the urn:mace:shibboleth:2.0:resolver namespace also allows a relaxation of the ordering requirements of child elements to reduce strictness.
Attributes
Any of the common attributes can be specified.
In addition, the following attributes may be provided:
Name | Type | Req? | Default | Description |
|---|---|---|---|---|
language | string | N | JavaScript | Defines the JSR-233 language to use. The default is ECMA script using either the Rhino (Java 7) or Nashorn (Java 8) engines. |
| string | N | The name of a Spring Bean defined elsewhere. This bean will be made available to the script with the name "custom". See the ScriptedAttributeDefinition for more details |
Child Elements
Any of the common child elements can be specified. In addition one of the following two elements must be defined:
| Name | Cardinality | Description |
|---|---|---|
<Script> |
| The contents define the script to execute |
<ScriptFile> | The contents define a file which contains the script to execute |
Script Context
The script will have the following variables available:
- resolutionContext
- AttributeResolutionContext for the current resolution request
- connectorResults
- a List which the connector populates with IdPAttribute objects. These form the output of the dataconnector.
- profileContext
- ProfileRequestContext for the current resolution request
- custom 3.2
- contains whatever was provided by the
customObjectRefattribute (see above)
- contains whatever was provided by the
- subjects 3.3
- an array of the java
javax.security.auth.Subjectobjects associated with this authorization. Note that these will only be present if the attribute resolution has been associated with an Authentication (and so this will not work for back channel requests).
- an array of the java
Examples
Spring Configuration 3.1
The Script Data Connector can be configured using the springResources or springResourcesRef attributes, but this is deprecated since it renders the "custom" object unusable.
A single bean can be specified, being of type EvaluableScript.