• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Tokens.SamlSerializer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.IdentityModel.Tokens.SamlSerializer的典型用法代码示例。如果您正苦于以下问题:C# SamlSerializer类的具体用法?C# SamlSerializer怎么用?C# SamlSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SamlSerializer类属于System.IdentityModel.Tokens命名空间,在下文中一共展示了SamlSerializer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ReadXml

        public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            if (!reader.IsStartElement(dictionary.DoNotCacheCondition, dictionary.Namespace))
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLBadSchema, dictionary.DoNotCacheCondition.Value)));

            // saml:DoNotCacheCondition is a empty element. So just issue a read for
            // the empty element.
            if (reader.IsEmptyElement)
            {
                reader.MoveToContent();
                reader.Read();
                return;
            }

            reader.MoveToContent();
            reader.Read();
            reader.ReadEndElement();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:27,代码来源:SamlDoNotCacheCondition.cs


示例2: ReadXml

 public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     if (!reader.IsStartElement(samlDictionary.DoNotCacheCondition, samlDictionary.Namespace))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLBadSchema", new object[] { samlDictionary.DoNotCacheCondition.Value })));
     }
     if (reader.IsEmptyElement)
     {
         reader.MoveToContent();
         reader.Read();
     }
     else
     {
         reader.MoveToContent();
         reader.Read();
         reader.ReadEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:SamlDoNotCacheCondition.cs


示例3: ReadXml

        public virtual void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            if (reader.IsStartElement(dictionary.Action, dictionary.Namespace))
            {
                // The Namespace attribute is optional.
                this.ns = reader.GetAttribute(dictionary.ActionNamespaceAttribute, null);

                reader.MoveToContent();
                this.action = reader.ReadString();
                if (string.IsNullOrEmpty(this.action))
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLActionNameRequiredOnRead)));

                reader.MoveToContent();
                reader.ReadEndElement();
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:SamlAction.cs


示例4: WSSecurityTokenSerializer

		public WSSecurityTokenSerializer (
			SecurityVersion securityVersion,
			bool emitBspRequiredAttributes,
			SamlSerializer samlSerializer)
			: this (securityVersion, emitBspRequiredAttributes, 
				samlSerializer, null, null)
		{
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:WSSecurityTokenSerializer.cs


示例5: ReadXml

 public virtual void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     string str2;
     string str3;
     if (reader == null)
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     string attribute = reader.GetAttribute(samlDictionary.AuthorityKind, null);
     if (string.IsNullOrEmpty(attribute))
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAuthorityBindingMissingAuthorityKindOnRead")));
     }
     string[] strArray = attribute.Split(new char[] { ':' });
     if (strArray.Length > 2)
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAuthorityBindingInvalidAuthorityKind")));
     }
     if (strArray.Length == 2)
     {
         str3 = strArray[0];
         str2 = strArray[1];
     }
     else
     {
         str3 = string.Empty;
         str2 = strArray[0];
     }
     string ns = reader.LookupNamespace(str3);
     this.authorityKind = new XmlQualifiedName(str2, ns);
     this.binding = reader.GetAttribute(samlDictionary.Binding, null);
     if (string.IsNullOrEmpty(this.binding))
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAuthorityBindingMissingBindingOnRead")));
     }
     this.location = reader.GetAttribute(samlDictionary.Location, null);
     if (string.IsNullOrEmpty(this.location))
     {
         throw System.IdentityModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAuthorityBindingMissingLocationOnRead")));
     }
     if (reader.IsEmptyElement)
     {
         reader.MoveToContent();
         reader.Read();
     }
     else
     {
         reader.MoveToContent();
         reader.Read();
         reader.ReadEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:57,代码来源:SamlAuthorityBinding.cs


示例6: WriteXml

		public override void WriteXml (XmlDictionaryWriter writer,
			SamlSerializer samlSerializer,
			SecurityTokenSerializer keyInfoTokenSerializer)
		{
			if (SamlSubject == null)
				throw new SecurityTokenException ("Subject is null in the AttributeStatement");
			writer.WriteStartElement ("saml", "AttributeStatement", SamlConstants.Namespace);
			SamlSubject.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
			foreach (SamlAttribute a in Attributes)
				a.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
			writer.WriteEndElement ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:SamlAttributeStatement.cs


示例7: WriteXml

		public override void WriteXml (
			XmlDictionaryWriter writer,
			SamlSerializer samlSerializer,
			SecurityTokenSerializer keyInfoSerializer)
		{
			if (writer == null)
				throw new ArgumentNullException ("writer");
			if (samlSerializer == null)
				throw new ArgumentNullException ("samlSerializer");
			writer.WriteStartElement ("saml", "DoNotCacheCondition", SamlConstants.Namespace);
			writer.WriteEndElement ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:SamlDoNotCacheCondition.cs


示例8: ReadXml

        public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            reader.MoveToContent();
            reader.Read();

            if (reader.IsStartElement(dictionary.Subject, dictionary.Namespace))
            {
                SamlSubject subject = new SamlSubject();
                subject.ReadXml(reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
                base.SamlSubject = subject;
            }
            else
            {
                // SAML Subject is a required Attribute Statement clause.
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLAttributeStatementMissingSubjectOnRead)));
            }

            while (reader.IsStartElement())
            {
                if (reader.IsStartElement(dictionary.Attribute, dictionary.Namespace))
                {
                    // SAML Attribute is a extensibility point. So ask the SAML serializer 
                    // to load this part.
                    SamlAttribute attribute = samlSerializer.LoadAttribute(reader, keyInfoSerializer, outOfBandTokenResolver);
                    if (attribute == null)
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLUnableToLoadAttribute)));
                    this.attributes.Add(attribute);
                }
                else
                {
                    break;
                }
            }

            if (this.attributes.Count == 0)
            {
                // Each Attribute statement should have at least one attribute.
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLAttributeStatementMissingAttributeOnRead)));
            }

            reader.MoveToContent();
            reader.ReadEndElement();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:52,代码来源:SamlAttributeStatement.cs


示例9: WriteXml

 public override void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer)
 {
     if (writer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     writer.WriteStartElement(samlDictionary.PreferredPrefix.Value, samlDictionary.DoNotCacheCondition, samlDictionary.Namespace);
     writer.WriteEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:SamlDoNotCacheCondition.cs


示例10: WriteXml

        public override void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer)
        {
            if (writer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer"));

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            writer.WriteStartElement(dictionary.PreferredPrefix.Value, dictionary.DoNotCacheCondition, dictionary.Namespace);
            writer.WriteEndElement();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:SamlDoNotCacheCondition.cs


示例11: WriteXml

		public override void WriteXml (
			XmlDictionaryWriter writer,
			SamlSerializer samlSerializer,
			SecurityTokenSerializer keyInfoSerializer)
		{
			if (writer == null)
				throw new ArgumentNullException ("writer");
			if (samlSerializer == null)
				throw new ArgumentNullException ("samlSerializer");
			if (Audiences.Count == 0)
				throw new SecurityTokenException ("SAML AudienceRestrictionCondition must contain at least one Audience.");

			writer.WriteStartElement ("saml", "AudienceRestrictionCondition", SamlConstants.Namespace);
			foreach (Uri a in Audiences)
				writer.WriteElementString ("saml", "Audience", SamlConstants.Namespace, a.AbsoluteUri);
			writer.WriteEndElement ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:17,代码来源:SamlAudienceRestrictionCondition.cs


示例12: ReadXml

 public virtual void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     if (reader.IsEmptyElement)
     {
         reader.MoveToContent();
         reader.Read();
     }
     else
     {
         reader.MoveToContent();
         reader.Read();
         while (reader.IsStartElement())
         {
             if (!reader.IsStartElement(samlDictionary.AssertionIdReference, samlDictionary.Namespace))
             {
                 if (!reader.IsStartElement(samlDictionary.Assertion, samlDictionary.Namespace))
                 {
                     throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLBadSchema", new object[] { samlDictionary.Advice.Value })));
                 }
                 SamlAssertion item = new SamlAssertion();
                 item.ReadXml(reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
                 this.assertions.Add(item);
             }
             else
             {
                 reader.MoveToContent();
                 this.assertionIdReferences.Add(reader.ReadString());
                 reader.MoveToContent();
                 reader.ReadEndElement();
                 continue;
             }
         }
         reader.MoveToContent();
         reader.ReadEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:45,代码来源:SamlAdvice.cs


示例13: ReadXml

 public virtual void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     string attribute = reader.GetAttribute(samlDictionary.NotBefore, null);
     if (!string.IsNullOrEmpty(attribute))
     {
         this.notBefore = DateTime.ParseExact(attribute, SamlConstants.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
     }
     attribute = reader.GetAttribute(samlDictionary.NotOnOrAfter, null);
     if (!string.IsNullOrEmpty(attribute))
     {
         this.notOnOrAfter = DateTime.ParseExact(attribute, SamlConstants.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
     }
     if (reader.IsEmptyElement)
     {
         reader.MoveToContent();
         reader.Read();
     }
     else
     {
         reader.MoveToContent();
         reader.Read();
         while (reader.IsStartElement())
         {
             SamlCondition item = samlSerializer.LoadCondition(reader, keyInfoSerializer, outOfBandTokenResolver);
             if (item == null)
             {
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLUnableToLoadCondtion")));
             }
             this.conditions.Add(item);
         }
         reader.MoveToContent();
         reader.ReadEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:43,代码来源:SamlConditions.cs


示例14: WriteXml

 public virtual void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer)
 {
     this.CheckObjectValidity();
     if (writer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     writer.WriteStartElement(samlDictionary.PreferredPrefix.Value, samlDictionary.Action, samlDictionary.Namespace);
     if (this.ns != null)
     {
         writer.WriteStartAttribute(samlDictionary.ActionNamespaceAttribute, null);
         writer.WriteString(this.ns);
         writer.WriteEndAttribute();
     }
     writer.WriteString(this.action);
     writer.WriteEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:SamlAction.cs


示例15: CreateSecurityTokenSerializer

        public override SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityTokenVersion version)
        {
            if (version == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("version");
            }
            MessageSecurityTokenVersion wsVersion = version as MessageSecurityTokenVersion;
            if (wsVersion != null)
            {
                SamlSerializer samlSerializer = null;
                if (parent.IssuedTokenAuthentication != null)
                    samlSerializer = parent.IssuedTokenAuthentication.SamlSerializer;
                else
                    samlSerializer = new SamlSerializer();

                return new WSSecurityTokenSerializer(wsVersion.SecurityVersion, wsVersion.TrustVersion, wsVersion.SecureConversationVersion, wsVersion.EmitBspRequiredAttributes, samlSerializer, parent.SecureConversationAuthentication.SecurityStateEncoder, parent.SecureConversationAuthentication.SecurityContextClaimTypes);
            }
            else
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SecurityTokenManagerCannotCreateSerializerForVersion, version)));
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:22,代码来源:ServiceCredentialsSecurityTokenManager.cs


示例16: ReadXml

        public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            reader.MoveToContent();
            reader.Read();
            while (reader.IsStartElement())
            {
                if (reader.IsStartElement(dictionary.Audience, dictionary.Namespace))
                {
                    reader.MoveToContent();
                    string audience = reader.ReadString();
                    if (string.IsNullOrEmpty(audience))
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLAudienceRestrictionInvalidAudienceValueOnRead)));

                    this.audiences.Add(new Uri(audience));
                    reader.MoveToContent();
                    reader.ReadEndElement();
                }
                else
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLBadSchema, dictionary.AudienceRestrictionCondition.Value)));
                }
            }

            if (this.audiences.Count == 0)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLAudienceRestrictionShouldHaveOneAudienceOnRead)));

            reader.MoveToContent();
            reader.ReadEndElement();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:38,代码来源:SamlAudienceRestrictionCondition.cs


示例17: ReadXml

 public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     reader.MoveToContent();
     reader.Read();
     while (reader.IsStartElement())
     {
         if (!reader.IsStartElement(samlDictionary.Audience, samlDictionary.Namespace))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLBadSchema", new object[] { samlDictionary.AudienceRestrictionCondition.Value })));
         }
         reader.MoveToContent();
         string str = reader.ReadString();
         if (string.IsNullOrEmpty(str))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAudienceRestrictionInvalidAudienceValueOnRead")));
         }
         this.audiences.Add(new Uri(str));
         reader.MoveToContent();
         reader.ReadEndElement();
     }
     if (this.audiences.Count == 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLAudienceRestrictionShouldHaveOneAudienceOnRead")));
     }
     reader.MoveToContent();
     reader.ReadEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:SamlAudienceRestrictionCondition.cs


示例18: ReadXml

 public virtual void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     if (reader.IsStartElement(samlDictionary.Action, samlDictionary.Namespace))
     {
         this.ns = reader.GetAttribute(samlDictionary.ActionNamespaceAttribute, null);
         reader.MoveToContent();
         this.action = reader.ReadString();
         if (string.IsNullOrEmpty(this.action))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(System.IdentityModel.SR.GetString("SAMLActionNameRequiredOnRead")));
         }
         reader.MoveToContent();
         reader.ReadEndElement();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:24,代码来源:SamlAction.cs


示例19: WriteXml

 public abstract void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer);
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:1,代码来源:SamlStatement.cs


示例20: WriteXml

 public virtual void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer)
 {
     this.CheckObjectValidity();
     if (writer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer"));
     }
     if (samlSerializer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));
     }
     SamlDictionary samlDictionary = samlSerializer.DictionaryManager.SamlDictionary;
     writer.WriteStartElement(samlDictionary.PreferredPrefix.Value, samlDictionary.Subject, samlDictionary.Namespace);
     if (this.name != null)
     {
         writer.WriteStartElement(samlDictionary.PreferredPrefix.Value, samlDictionary.NameIdentifier, samlDictionary.Namespace);
         if (this.nameFormat != null)
         {
             writer.WriteStartAttribute(samlDictionary.NameIdentifierFormat, null);
             writer.WriteString(this.nameFormat);
             writer.WriteEndAttribute();
         }
         if (this.nameQualifier != null)
         {
             writer.WriteStartAttribute(samlDictionary.NameIdentifierNameQualifier, null);
             writer.WriteString(this.nameQualifier);
             writer.WriteEndAttribute();
         }
         writer.WriteString(this.name);
         writer.WriteEndElement();
     }
     if (this.confirmationMethods.Count > 0)
     {
         writer.WriteStartElement(samlDictionary.PreferredPrefix.Value, samlDictionary.SubjectConfirmation, samlDictionary.Namespace);
         foreach (string str in this.confirmationMethods)
         {
             writer.WriteElementString(samlDictionary.SubjectConfirmationMethod, samlDictionary.Namespace, str);
         }
         if (!string.IsNullOrEmpty(this.confirmationData))
         {
             writer.WriteElementString(samlDictionary.SubjectConfirmationData, samlDictionary.Namespace, this.confirmationData);
         }
         if (this.securityKeyIdentifier != null)
         {
             SamlSerializer.WriteSecurityKeyIdentifier(XmlDictionaryWriter.CreateDictionaryWriter(writer), this.securityKeyIdentifier, keyInfoSerializer);
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:50,代码来源:SamlSubject.cs



注:本文中的System.IdentityModel.Tokens.SamlSerializer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tokens.SecurityKey类代码示例发布时间:2022-05-26
下一篇:
C# Tokens.JwtSecurityTokenHandler类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap