Deserialize SAML Config Attributes

Hi support,

Can you please assist to provide an example webform c# code that is able to programmatically retrieve saml config value for PartnerIdentityProvider attributes as I’m struggling to deserialize the xml.

For example, I would like to get value for the following node:
:https://www.componentspace.com/Forums/Uploads/Images/af4793cc-c1b9-4f8a-a29a-c81d.png

Regards,
Kah Kin

Hi Kah
Under the ComponentSpace.SAML2.Configuration namespace you’ll find the various classes supporting SAML configuration.
The SAMLConfiguration includes a constructor that takes an XmlElement and may be used to deserialize an entire SAML configuration.
The PartnerIdentityProviderConfiguration class handles the partner identity provider configuration which includes the three properties you listed.


[quote]
ComponentSpace - 3/21/2019
Hi Kah
Under the ComponentSpace.SAML2.Configuration namespace you'll find the various classes supporting SAML configuration.
The SAMLConfiguration includes a constructor that takes an XmlElement and may be used to deserialize an entire SAML configuration.
The PartnerIdentityProviderConfiguration class handles the partner identity provider configuration which includes the three properties you listed.


[/quote]

Please correct me if I'm wrong, based on my understanding the code should be as following?

But as per screenshot is shown, when compare with saml-config, the properties value is different. I tried with other properties and none of them matched. I assume the reference method is incorrect?
Please kindly assist.

Thank you.

I’m not sure what Common.VerifyAccess is.
Your code has constructed a ParnerIdentityProviderConfiguration which sets the SignAuthnRequest etc to their default values of false.
This doesn’t load the saml.config file.
As I mentioned, if you wish to deserialize a saml.config file, you need to call the SAMLConfiguration constructor that takes an XmlElement