Page tree

Previous Stable Release

Please note that the V3 release branch is now the previous stable release, with the current stable releases from the V4 branch.
Support for V3 will end on or around Dec 31, 2020.

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

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

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:ad namespace, the schema for which is located at http://shibboleth.net/schema/idp/shibboleth-attribute-resolver-ad.xsd. This is still supported, but every element or type in the  urn:mace:shibboleth:2.0:resolver:ad 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.

Child Elements

Any of the common child elements can be specified. In addition the following elements are supported:

NameCardinalityDescription
<DefaultValue>0 or 1Describes the action to be taken if any input value does not match one of the <ValueMap> SourceValue elements that follow. If the passThru attribute 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 moreSee below.

<ValueMap>

The <ValueMap> element supports two child elements:

NameCardinalityDescription
<ReturnValue>
1The 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 <ReturnValue> is output.

The partialMatch attribute (defaults to false) allows partial matches to be performed (any string which contains the pattern is a match). If partialMatch is false then the pattern is matched as a Java Regular Expression and all matches are replaced by the return value.

The ignoreCase attribute (default false) allows case insensitive comparisons to be made. This is only valid for regular expression matching.

Example

<AttributeDefinition id="mapped" xsi:type="Mapped" sourceAttributeID="uid">
    <Dependency ref="uid" />
    <DefaultValue passThru="true"/>
	<ValueMap>
		<ReturnValue>return1</ReturnValue>
		<SourceValue>sou.+rc.+e1</SourceValue>
		<SourceValue partialMatch="true" ignoreCase="true">fred</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>
  • No labels