ComponentSpace

Forums



Having trouble embedding XML in the node


Having trouble embedding XML in the node

Author
Message
m4ddog74
m4ddog74
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 9
Hi,

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_Info>AuthType=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?

Thanks!
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
Could you please confirm that the following XML is the required SAML attribute value?

<BPP1:Sso_Auth_Info>AuthType=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.


Regards
ComponentSpace Development
m4ddog74
m4ddog74
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 9
Hi,

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

ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
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 [email protected] mentioning this topic. I'd like to see which API you are using and what's happening with the attribute. Thanks.

http://www.componentspace.com/Forums/17/Enabing-SAML-Trace



Regards
ComponentSpace Development
m4ddog74
m4ddog74
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 9
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.
Attachments
idp.log (194 views, 15.00 KB)
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
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("<Address><Street>1234 Main Street</Street><Town>Any Town</Town><Zip>56789</Zip></Address>")  
addressAttribute.Values.Add(New AttributeValue(xmlDocument.DocumentElement))  
attributeStatement = New AttributeStatement()  
attributeStatement.Attributes.Add(addressAttribute)  


samlAssertion.Statements.Add(attributeStatement)


Regards
ComponentSpace Development
m4ddog74
m4ddog74
New Member
New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)New Member (5 reputation)

Group: Forum Members
Posts: 4, Visits: 9
Hi,

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!
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.8K
You're most welcome. I'm glad you got everything working and thank you for letting me know.

Regards
ComponentSpace Development
[email protected]
wells_t@subway.com
New Member
New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)

Group: Forum Members
Posts: 3, Visits: 3
I am using this code exactly as specified and my xml is still correct.  
The result I get is:
<saml:AttributeStatement>
    <saml:Attribute Name="Store" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
      <saml:AttributeValue>System.Xml.XmlDocument</saml:AttributeValue>
    </saml:Attribute>
   </saml:AttributeStatement>

Any thoughts?  Thanks in advance.
[email protected]
wells_t@subway.com
New Member
New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)

Group: Forum Members
Posts: 3, Visits: 3
I meant to say incorrect.
GO


Similar Topics


Execution: 0.000. 2 queries. Compression Enabled.
Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....









Forums, Documentation & Knowledge Base - ComponentSpace


Search