Having trouble embedding XML in the node


I need to embed the following text as is into the saml:AttributeStament. The problem I am having is with the ‘=’ . When i place the xml in as is, nothing is generated. When I take them out, and leave everything else,I am getting something outpt within the saml:AttributeStament. Unfortunately the vendor I am working with needs it to be exactly as it is specified below. I have tried using htm escape characters and replacing the ‘=’ with %3D; but this doesn work as well.

BPP1:Sso_Auth_InfoAuthType=7|TpaID=TXXXX|EmprID=XXXXXX|EmpeID=XXXX/XXXXPortalID=1|Profile=Employee Standard<;/BPP1:Sso_Auth_Info>

Anyone have any ideas how I get around this?


Could you please confirm that the following XML is the required SAML attribute value?

BPP1:Sso_Auth_InfoAuthType=7|TpaID=TXXXX|EmprID=XXXXXX|EmpeID=XXXX/XXXXPortalID=1|Profile=Employee Standard<;/BPP1:Sso_Auth_Info>

Also, are you using the low-level or high-level SAML API to construct the SAML assertion?


Thanks for the response. That is the correct XML that I need to post. Unfortunately I don’t know if I am using High-LEvel or Low-Level API because this had been abstracted for us at work. If there is a way to determine this please let know. Hopefully some of the information below might help make that determination. Also, is there a link to documnentation or tutorials? Or is there only the knowledge base in the forums?

Below is an example of what is being posted currently. This is just for the AttributStatement node. To generate this I have replaced the ‘=’ with ‘zz’. This fails though when I post this to the vendor site. I have an xml file stored on disk that I read in from and then add as an option in the function CreateIdentityProviderOptions. I tried replacing the ‘=’ with 3%D; but this didn’t work either.

<saml:AttributeStatement>      <saml:Attribute Name=FISAttributes>        <saml:AttributeValue>          <IOP:MtvnSvcReq>          <IOP:MtvnSvcVer>1.0</IOP:MtvnSvcVer>          <IOP:MsgUUID>430ec2ff-10e2-448e-8a7a-14a698f4eec3</IOP:MsgUUID>          <IOP:PrcsParms>          <IOP:SrcID>COMRCA</IOP:SrcID>          </IOP:PrcsParms>          <IOP:Svc>          <IOP:SvcParms>          <IOP:ApplID>WCP</IOP:ApplID>          <IOP:SvcID>ExternInterop</IOP:SvcID>          <IOP:SvcVer>2.0</IOP:SvcVer>          <IOP:RoutingID>COMRCA</IOP:RoutingID>          </IOP:SvcParms>          <IOP:Security>          <IOP:NoAuth></IOP:NoAuth>          </IOP:Security>          <IOP:MsgData>          <IOP1:ExtIntOp>          <IOP1:Interop>          <IOP1:DestSys>WCP</IOP1:DestSys>          <IOP1:DestActy>SingleSignOn</IOP1:DestActy>          <IOP1:DestActyVer>1.0</IOP1:DestActyVer>          </IOP1:Interop>          <IOP1:InteropData>          <IOP1:TP>          <BPP1:LaunchBPPActy>          ><BPP1:sso_auth_info>AuthTypezz7|TpaIDzzTXXXX|EmprIDzzXXXXXX|EmpeIzzXXXX/XXXXPortalIDzz1|ProfilezzEmployee Standard</BPP1:sso_auth_info>          </BPP1:LaunchBPPActy>          </IOP1:TP>          </IOP1:InteropData>          </IOP1:ExtIntOp>          </IOP:MsgData>          </IOP:Svc>          </IOP:MtvnSvcReq>        </saml:AttributeValue>      </saml:Attribute>    </saml:AttributeStatement>

If you’re using the high-level API then we automatically detect whether the SAML attribute value is XML or a non-XML string. I did some experimenting sending your XML as a SAML attribute and noticed a couple of things. The terminating XML tag included a semicolon after the less than sign (ie <;/BPP1:Sso_Auth_Info>). Also, the BPP1 prefix doesn’t have a corresponding namespace declaration.
I changed your XML to:
<Sso_Auth_Info>AuthType=7|TpaID=TXXXX|EmprID=XXXXXX|EmpeID=XXXX/XXXXPortalID=1|Profile=Employee Standard</Sso_Auth_Info>

I was able to successfully send this as XML with the equal signs etc.
If you need to include the XML prefix then you will also need to include the namespace declaration.
I suggest double checking the XML.
Also, please enable SAML trace and send the generated log file to support@componentspace.com mentioning this topic. I’d like to see which API you are using and what’s happening with the attribute. Thanks.


Thanks. I used your XML exactly in my code and still had the same results. I did turn on the logging though. I have attached the generated log. Would this contain any information as to what is causing the problem?

Also where is the link to the example projects?


Thanks for the log. I see that you’re using a relatively old version of the product which means you are using the low-level API.
The code below is from the AssertionExample project that we include and that you should have. It’s in VB.NET but if you’re using C# hopefully it’s easy enough to follow the syntax.
The important thing to note is call to SAMLAttribute.RegisterAttributeValueSerializer. You will need to make a similar call so the SAML API knows to treat the attribute value as XML rather than as a string. The high-level API handles this automatically for you but with the low-level API you need to do this yourself.
Please include this call in your code. If there’s still an issue, please send me a section of code demonstrating the issue. Thanks.

’ Include an attribute containing XML as its value.
’ To correctly serialize/deserialize the value as XML rather than a string,
’ the correct serializer must be registered for the attribute.
’ In this example the Address attribute is XML.
SAMLAttribute.RegisterAttributeValueSerializer(“Address”, Nothing, New XmlAttributeValueSerializer())
Dim addressAttribute As New SAMLAttribute(“Address”, SAMLIdentifiers.AttributeNameFormats.Unspecified, Nothing)
Dim xmlDocument As New XmlDocument()
xmlDocument.PreserveWhitespace = True
xmlDocument.LoadXml(“1234 Main StreetAny Town56789”)
addressAttribute.Values.Add(New AttributeValue(xmlDocument.DocumentElement))
attributeStatement = New AttributeStatement()



I wanted to thank you for your help. I finally was able to get everything to work. It had nothing to do with the ComponentSpace libraries. I was an issue with some base code in the solution that was written by another team in my organization.

Thank you again!

You’re most welcome. I’m glad you got everything working and thank you for letting me know.

I am using this code exactly as specified and my xml is still correct.
The result I get is:
<saml:Attribute Name=“Store” NameFormat=“urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified”>

Any thoughts? Thanks in advance.

I meant to say incorrect.

My bad. I was missing a critical line of code:
SAMLAttribute.RegisterAttributeValueSerializer(attributeDetails.Name, null, new XmlAttributeValueSerializer());

I’m glad you got it working and thanks for letting us know.