Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed typo in namespace

...

The SAML 2 string attribute encoder creates SAML 2 <Attribute> elements from resolved attributes with <AttributeValue> elements for each value. The content of these <AttributeValue> elements is a string created by invoking the resolve attribute values Object. toString() method. This encoder is only used for SAML 2 messages and will be ignored when the IdP is answering other protocol messages.

Note

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 after any dependencies with an in a <resolver:AttributeDefinition> after all <resolver:AttributeDefinition>. The Dependency>.

To define a new SAML 2 string attribute encoders starts with the same <resolver:AttributeEncoder> element as all other encoders and has a type of encoder, create a <resolver:AttributeEncoder xsi:type="SAML2String" xmlns=". The <resolver:AttributeEncoder> may also have the following the urn:mace:shibboleth:2.0:attribute:encoder"> with the following required attributes:

  • name - this becomes the NAME Name attribute on the created SAML 1 2 <Attribute> element; this attribute is required

and the following optional attributes:

  • nameFormat - this becomes the NameFormat attribute on the created SAML 2 <Attribute> element ; defaults to (default value: urn:oasis:names:tc:SAML:2.0:attrname-format:uri)
  • friendlyName - this becomes the FriendlyName attribute on the created SAML 2 <Attribute> element; this attribute is optional
Code Block
xml
xml
titleSAML 2 String Attribute Encoder within a Simple Attribute Definition

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

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

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

     <resolver:AttributeEncoder xsi:type="enc:SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
                                                     name="ATTRIBUTE_NAME_2"
           
                                          nameFormat="ATTRIBUTE_NAME_FORMAT"
                     
                                friendlyName="ATTRIBUTE_FRIENDLY_NAME" />

</resolver:AttributeDefinition>

...