Ejemplo n.º 1
0
        public XElement Serialize()
        {
            var result = new XElement(Constants.XMLNamespaces.SAML + "Assertion",
                                      // new XAttribute("xmlns", Constants.XMLNamespaces.SAML),
                                      new XAttribute("AssertionID", AssertionId),
                                      new XAttribute("IssueInstant", IssueInstant.ToUTCString()),
                                      new XAttribute("Issuer", Issuer),
                                      new XAttribute("MajorVersion", MajorVersion),
                                      new XAttribute("MinorVersion", MinorVersion));

            if (Conditions != null)
            {
                result.Add(Conditions.Serialize());
            }

            if (AuthenticationStatement != null)
            {
                result.Add(AuthenticationStatement.Serialize());
            }

            if (AttributeStatement != null)
            {
                result.Add(AttributeStatement.Serialize());
            }

            if (Signature != null)
            {
                result.Add(Signature.Serialize());
            }

            return(result);
        }
Ejemplo n.º 2
0
        public XElement Serialize()
        {
            var result = new XElement(Constants.XMLNamespaces.SAMLP + "Request",
                                      new XAttribute(XNamespace.Xmlns + "samlp", Constants.XMLNamespaces.SAMLP),
                                      new XAttribute(XNamespace.Xmlns + "ds", Constants.XMLNamespaces.DS),
                                      new XAttribute(XNamespace.Xmlns + "saml", Constants.XMLNamespaces.SAML),
                                      new XAttribute("IssueInstant", IssueInstant.ToUTCString()),
                                      new XAttribute("MajorVersion", MajorVersion),
                                      new XAttribute("MinorVersion", MinorVersion),
                                      new XAttribute("RequestID", RequestId));

            if (Signature != null)
            {
                result.Add(Signature.Serialize());
            }

            if (AttributeQuery != null)
            {
                result.Add(AttributeQuery.Serialize());
            }

            return(result);
        }