Some suggested changes

Jul 29, 2015 at 10:19 AM
Hello,

Inside SAML2\Schema\Core\SamlAttribute.cs it's better to change type of AttributeValue from string[] to object[]:
[XmlElement("AttributeValue", IsNullable = true, Order = 1)]
public object[] AttributeValue { get; set; }
In this way, when the SAML Assertion is serialized, it will show the xsi:type attribute on the saml:AttributeValue node.

Moreover, in order to not put excessive namespaces declarations on every AttributeValue node, it's better to change inside SAML2\Utils\Serialization.cs the static constructor in this way:
static Serialization()
{
      XmlNamespaces = new XmlSerializerNamespaces();
      XmlNamespaces.Add("samlp", Saml20Constants.Protocol);
      XmlNamespaces.Add("saml", Saml20Constants.Assertion);
      XmlNamespaces.Add("xsi", Saml20Constants.Xsi);
      XmlNamespaces.Add("xs", Saml20Constants.Xs);
}
So all the namespaces will be in the root node, and not in every node.

What do you think ?