Ejemplo n.º 1
0
        public static AuthnStatementType Load(XElement AuthnStatementElement)
        {
            var ct = new AuthnStatementType();

            foreach (var a in AuthnStatementElement.Attributes())
            {
                switch (a.Name.LocalName)
                {
                case "AuthnInstant": ct.AuthnInstant = (DateTime)a; break;

                case "SessionIndex": ct.SessionIndex = (string)a; break;

                case "SessionNotOnOrAfter": ct.SessionNotOnOrAfter = (DateTime)a; break;
                }
            }

            foreach (var e in AuthnStatementElement.Elements())
            {
                switch (e.Name.LocalName)
                {
                //case "SubjectLocality": ct.SubjectLocality = SubjectLocalityType.Load(e); break;
                case "AuthnContext": ct.AuthnContext = AuthnContextType.Load(e); break;
                }
            }
            return(ct);
        }
Ejemplo n.º 2
0
        public static AuthnContextType Load(XElement AuthnContextElement)
        {
            var ct = new AuthnContextType
            {
                //AuthenticatingAuthorities = (from e in AuthnContextElement.Elements( NA.saml + "AuthenticatingAuthority" )
                //                            select new Uri( e.Value)).ToList()
                AuthenticatingAuthorities = (from e in AuthnContextElement.Elements(NA.saml + "AuthenticatingAuthority")
                                             select e.Value).ToList()
            };

            foreach (var a in AuthnContextElement.Elements())
            {
                switch (a.Name.LocalName)
                {
                case "AuthnContextClassRef": ct.AuthnContextClassRef = new Uri(a.Value); break;

                case "AuthnContextDecl": ct.AuthnContextDecl = new Uri(a.Value); break;

                case "AuthnContextDeclRef": ct.AuthnContextDeclRef = new Uri(a.Value); break;
                }
            }

            return(ct);
        }