SAML 2 Scoped String Attribute Encoder

The SAML 2 scoped string attribute encoder creates SAML 2 <Attribute> elements from resolved scoped attributes with <AttributeValue> elements for each value. The content of these <AttributeValue> elements are strings and the scope value of the containing <AttributeDefinition>. The method of combining this scope value is configurable. This encoder is only used for SAML 2 messages and will be ignored when the IdP is answering other protocol messages.

This encoder will convert the values of the attribute it is attached into strings by means of the Object.toString() method.

Define the Encoder

Attribute encoders are defined in a <resolver:AttributeDefinition> after all <resolver:Dependency>.

To define a new SAML 2 scoped string attribute encoder, create a <resolver:AttributeEncoder xsi:type="SAML2ScopedString" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"> with the following required attributes:

and the following optional attributes:

<resolver:AttributeDefinition id="UNIQUE_ID" xsi:type="ad:Scoped">

     <resolver:Dependency ref="DEFINITION_ID_1" />
     <resolver:Dependency ref="DEFINITION_ID_2" />
     <resolver:Dependency ref="CONNECTOR_ID_3" />
     <resolver:Dependency ref="CONNECTOR_ID_4" />

     <resolver:AttributeEncoder xsi:type="SAML2ScopedString" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                                name="ATTRIBUTE_NAME_1" />

     <resolver:AttributeEncoder xsi:type="SAML2ScopedString" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                                name="ATTRIBUTE_NAME_2"
                                nameFormat="ATTRIBUTE_NAME_FORMAT"
                                friendlyName="ATTRIBUTE_FRIENDLY_NAME" 
                                scopeType="attribute" 
                                scopeAttribute="ATTRIBUTE_SCOPE_ATTRIBUTE_NAME" />

     <resolver:AttributeEncoder xsi:type="SAML2ScopedString" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                                name="ATTRIBUTE_NAME_3"
                                nameFormat="ATTRIBUTE_NAME_FORMAT"
                                friendlyName="ATTRIBUTE_FRIENDLY_NAME" 
                                scopeType="inline" 
                                scopeDelimiter="#" />

</resolver:AttributeDefinition>

Defining more than one attribute encoder allows a deployer to transform a single attribute into multiple <Attribute> elements with different names, name formats, or friendly names.