...
- language - the JSR-223 name of the scripting language used within the script (default value: javascript)
- dependencyOnly - a boolean flag that indicates the attribute produced by this definition is used only by other resolver components are should not be released from the resolver (default value: false)
Code Block |
---|
| xml |
---|
| xml |
---|
title | Script Attribute Definition with inline scriptxml |
---|
|
<resolver:AttributeDefinition xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="UNIQUE_ID">
<!-- Remaining configuration from the next step go here -->
</resolver:AttributeDefinition>
|
...
Dependencies are expressed by the <resolver:Dependency>
with a ref
attribute whose value is the unique ID of the attribute definition or the data connector that this connector depends on.
Code Block |
---|
| xml |
---|
| xml |
---|
title | Script Attribute Definition with Dependenciesxml |
---|
|
<resolver:AttributeDefinition xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="UNIQUE_ID">
<resolver:Dependency ref="DEFINITION_ID_1" />
<resolver:Dependency ref="DEFINITION_ID_2" />
<resolver:Dependency ref="CONNECTOR_ID_3" />
<resolver:Dependency ref="CONNECTOR_ID_4" />
<!-- Remaining configuration from the next step go here -->
</resolver:AttributeDefinition>
|
...
Warning |
---|
title | Attribute IDs may contain illegal characters |
---|
|
Some scripting languages place certain restrictions on variable names (e.g. may not contain a "-"). Ensure that any attribute you wish to use does not contain such an illegal character in its ID. If it does use a Simple Attribute Definition to create a new attribute, with a different ID, whose source attribute is the attribute with the problematic ID. |
Code Block |
---|
| xml |
---|
| xml |
---|
title | Script Attribute Definition with Inline Scriptxml |
---|
|
<resolver:AttributeDefinition xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="fullName">
<!-- Dependency information would go here -->
<Script><![CDATA[
importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
fullname = new BasicAttribute("fullname");
fullname.getValues().add(givenName.getValues().get(0) + " " + sn.getValues().get(0));
]]></Script>
</resolver:AttributeDefinition>
|
Code Block |
---|
| xml |
---|
| xml |
---|
title | Script Attribute Definition with Script Filexml |
---|
|
<resolver:AttributeDefinition xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="UNIQUE_ID" >
<!-- Dependency information would go here -->
<ScriptFile>/usr/local/shibboleth-idp/script/myScript.js</ScriptFile>
</resolver:AttributeDefinition>
|
...