Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Table of Contents
maxLevel3

Overview

The Mapped AttributeDefinition performs a many-to-one mapping from source attributes values to a return value according to a series of mapping statements. If an input value matches no mapping rule, then a default can be provided.

Reference

Localtabgroup
Localtab live
titleSpecific XML Attributes

Name

Cardinality

Description

<DefaultValue>

0 or 1

Describes the action to be taken if any input value does not match one of the <ValueMap>'s <SourceValue> elements that follow. If the passThruattribute is set to "true", then the input value is passed through untouched, otherwise the contents of the element are used as the default value.

<ValueMap>

1 or more

The <ValueMap> element supports two child elements: <ReturnValue> and <SourceValue> See below


ValueMap child

Element Name

Cardinality

Description

<ReturnValue>

1

The content is used as the output value if any of the source values match. Replacement rules from 

java.util.regex.

Matcher.replaceAll(

java.lang.

String) apply.

<SourceValue>

1 or more

The content is matched against each input value and if it matches, then the mapped <ReturnValue> is output. The mapping process depends on the value of the partialMatch attribute, which defaults to false.

If partialMatch is set to true, then the source value is checked for containment within the input value, and if so, the return value replaces the original.

If partialMatch is set to false, then the source value is a Java Regular Expression applied to the input value, and if a match, then the return value is applied as a replacement, with all matches replaced by the return value.

Setting the caseSensitive attribute (default true) to false allows case insensitive comparisons to be made. This is only valid for regular expression matching (i.e., when partialMatch is false).


Localtab live
titleCommon XML Attributes
Include Page
AttributeDefinitionCommonAttributes
AttributeDefinitionCommonAttributes
Localtab live
titleCommon XML Elements

At least one dependency element is required.

Include Page
AttributeDefinitionCommonChildElements
AttributeDefinitionCommonChildElements

Example

Code Block
languagexml
<AttributeDefinition id="mapped" xsi:type="Mapped">
    <InputAttributeDefinition ref="uid" />
    <DefaultValue passThru="true"/>
	<ValueMap>
		<ReturnValue>return1</ReturnValue>
		<SourceValue>sou.+rc.+e1</SourceValue>
		<SourceValue partialMatch="true">fred</SourceValue>
		<SourceValue caseSensitive="false">Ignore.+Case.+When.+Comparing</SourceValue>
	</ValueMap>
	<ValueMap>
		<ReturnValue>return1</ReturnValue>
		<SourceValue>source2</SourceValue>
	</ValueMap>
	<ValueMap>
		<ReturnValue>some_string_to_add_before_value:$1</ReturnValue>
		<SourceValue>(.+)</SourceValue>
	</ValueMap>
    <AttributeEncoder xsi:type="SAML2String" name="https://example.org/example/name" friendlyName="Mapped" encodeType="false" />
 </AttributeDefinition>

...