SAML 2 String Attribute Encoder
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.
Define the Encoder
Attribute encoders are defined after any dependencies with an <resolver:AttributeDefinition>
. The SAML 2 string attribute encoders starts with the same <resolver:AttributeEncoder>
element as all other encoders and has a type of xsi:type="SAML2String"
. The <resolver:AttributeEncoder>
may also have the following the attributes:
name
- this becomes theNAME
attribute on the created SAML 1<Attribute>
element; this attribute is requirednameFormat
- this becomes theNameFormat
attribute on the created SAML 2<Attribute>
element; defaults to urn:oasis:names:tc:SAML:2.0:attrname-format:urifriendlyName
- this becomes theFriendlyName
attribute on the created SAML 2<Attribute>
element; this attribute is optional
<resolver:AttributeDefinition id="UNIQUE_ID" xsi:type="ad:Simple"> <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="enc:SAML2String" name="ATTRIBUTE_NAME_1" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="ATTRIBUTE_NAME_2" nameFormat="ATTRIBUTE_NAME_FORMAT" friendlyName="ATTRIBUTE_FRIENDLY_NAME" /> </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.