The Shibboleth IdP V4 software will leave support on September 1, 2024.

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 14 Current »

Namespace: urn:mace:shibboleth:2.0:resolver
Schema: http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd

Overview

The <RecordMapping> element provides an instance of the StorageMappingStrategy interface that produces result attributes from a StorageService record using a script. The supplied script is expected to consume a StorageRecord instance and produce any desired results. It may raise exceptions if necessary.

Note that Javascript interpreters include a JSON object that automates the parsing of JSON data.

Reference

The <RecordMapping> element is a configuration element of type ScriptType.

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

 XML Attributes

Name

Type

Default

Description

language

String

javascript

Defines the JSR-223 language to use

customObjectRef

Bean ID

Any 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 the normal script context discussed below

 XML Elements

Name

Cardinality

Description

<Script>


Exactly One

An inline script

<ScriptFile>

Path to a local file or classpath resource containing the script

The script may be stored in a local file (with <ScriptFile>) or written inline (with <Script>). An inline script should be wrapped with a CDATA section to prevent interpretation of any special XML characters that may be included in the script.

Always wrap inline scripts with a CDATA section

Always wrap inline scripts with a CDATA section, even if the script contains no special XML characters. This will future-proof your script.

Script Context

These variables are available in the template context:

Name

Description

record

Instance of StorageRecord to process

log

A class logger for debugging

custom

Custom object supplied via customObjectRef configuration attribute, if any

connectorResults

Pre-defined Set<IdPAttribute> variable to populate with output results

Unlike a lot of the scripted versions of objects across the system, there is no direct access to the ProfileRequestContext tree that exposes the state of the request. However, it's easy to get access to it by using a servlet request attribute named "opensamlProfileRequestContext". You can inject the servlet request object through the customObjectRef hook (set it to "shibboleth.HttpServletRequest" or "shibboleth.HttpServletRequestSupplier" in V4.3 and later).

  • No labels