protected SspiSecurityTokenParameters(SspiSecurityTokenParameters other) : base(other)
 {
     this.requireCancellation = other.requireCancellation;
     if (other.issuerBindingContext != null)
     {
         this.issuerBindingContext = other.issuerBindingContext.Clone();
     }
 }
 protected SspiSecurityTokenParameters(SspiSecurityTokenParameters other) : base(other)
 {
     this.requireCancellation = other.requireCancellation;
     if (other.issuerBindingContext != null)
     {
         this.issuerBindingContext = other.issuerBindingContext.Clone();
     }
 }
        public virtual bool TryImportWsspSpnegoContextTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters)
        {
            parameters = null;

            SecurityTokenInclusionMode inclusionMode;
            Collection<Collection<XmlElement>> alternatives;

            if (IsWsspAssertion(assertion, SpnegoContextTokenName)
                && TryGetIncludeTokenValue(assertion, out inclusionMode))
            {
                if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives))
                {
                    foreach (Collection<XmlElement> alternative in alternatives)
                    {
                        SspiSecurityTokenParameters sspi = new SspiSecurityTokenParameters();
                        parameters = sspi;
                        bool requireCancellation;
                        if (TryImportWsspRequireDerivedKeysAssertion(alternative, sspi)
                            && TryImportWsspMustNotSendCancelAssertion(alternative, out requireCancellation)
                            && alternative.Count == 0)
                        {
                            sspi.RequireCancellation = requireCancellation;
                            sspi.InclusionMode = inclusionMode;
                            break;
                        }
                        else
                        {
                            parameters = null;
                        }
                    }
                }
                else
                {
                    parameters = new SspiSecurityTokenParameters();
                    parameters.RequireDerivedKeys = false;
                    parameters.InclusionMode = inclusionMode;
                }
            }

            return parameters != null;
        }
 public virtual XmlElement CreateWsspSpnegoContextTokenAssertion(MetadataExporter exporter, SspiSecurityTokenParameters parameters)
 {
     XmlElement result = CreateWsspAssertion(SpnegoContextTokenName);
     SetIncludeTokenValue(result, parameters.InclusionMode);
     result.AppendChild(
         CreateWspPolicyWrapper(
             exporter,
             CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys),
             CreateWsspMustNotSendCancelAssertion(parameters.RequireCancellation)
     ));
     return result;
 }
 protected SspiSecurityTokenParameters(SspiSecurityTokenParameters source)
     : base(source)
 {
     this.cancel = source.cancel;
 }
		protected SspiSecurityTokenParameters (SspiSecurityTokenParameters source)
			: base (source)
		{
			this.cancel = source.cancel;
		}
 protected SspiSecurityTokenParameters(SspiSecurityTokenParameters other)
 {
   Contract.Requires(other != null);
 }
 public virtual XmlElement CreateWsspSpnegoContextTokenAssertion(MetadataExporter exporter, SspiSecurityTokenParameters parameters)
 {
     XmlElement tokenAssertion = this.CreateWsspAssertion("SpnegoContextToken");
     this.SetIncludeTokenValue(tokenAssertion, parameters.InclusionMode);
     tokenAssertion.AppendChild(this.CreateWspPolicyWrapper(exporter, new XmlElement[] { this.CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys), this.CreateWsspMustNotSendCancelAssertion(parameters.RequireCancellation) }));
     return tokenAssertion;
 }
 public virtual bool TryImportWsspSpnegoContextTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters)
 {
     SecurityTokenInclusionMode mode;
     parameters = null;
     if (this.IsWsspAssertion(assertion, "SpnegoContextToken") && this.TryGetIncludeTokenValue(assertion, out mode))
     {
         Collection<Collection<XmlElement>> collection;
         if (this.TryGetNestedPolicyAlternatives(importer, assertion, out collection))
         {
             foreach (Collection<XmlElement> collection2 in collection)
             {
                 bool flag;
                 SspiSecurityTokenParameters parameters2 = new SspiSecurityTokenParameters();
                 parameters = parameters2;
                 if ((this.TryImportWsspRequireDerivedKeysAssertion(collection2, parameters2) && this.TryImportWsspMustNotSendCancelAssertion(collection2, out flag)) && (collection2.Count == 0))
                 {
                     parameters2.RequireCancellation = flag;
                     parameters2.InclusionMode = mode;
                     break;
                 }
                 parameters = null;
             }
         }
         else
         {
             parameters = new SspiSecurityTokenParameters();
             parameters.RequireDerivedKeys = false;
             parameters.InclusionMode = mode;
         }
     }
     return (parameters != null);
 }
 protected SspiSecurityTokenParameters(SspiSecurityTokenParameters other)
     : base(other)
 {
     this.cancel = other.cancel;
 }
 protected SspiSecurityTokenParameters(SspiSecurityTokenParameters other)
 {
     Contract.Requires(other != null);
 }
        public override bool TryImportWsspSpnegoContextTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters)
        {
            parameters = null;

            SecurityTokenInclusionMode inclusionMode;
            Collection<Collection<XmlElement>> alternatives;

            if (IsWsspAssertion(assertion, SpnegoContextTokenName)
                && TryGetIncludeTokenValue(assertion, out inclusionMode))
            {
                if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives))
                {
                    foreach (Collection<XmlElement> alternative in alternatives)
                    {
                        SspiSecurityTokenParameters sspi = new SspiSecurityTokenParameters();
                        parameters = sspi;
                        bool requireCancellation;
                        bool canRenewSession;
                        if (TryImportWsspRequireDerivedKeysAssertion(alternative, sspi)
                            && TryImportWsspMustNotSendCancelAssertion(alternative, out requireCancellation)
                            && TryImportWsspMustNotSendAmendAssertion(alternative)
                            // We do not support Renew for spnego and sslnego. Read the 
                            // assertion if present and ignore it.
                            && TryImportWsspMustNotSendRenewAssertion(alternative, out canRenewSession)
                            && alternative.Count == 0)
                        {
                            // Client always set this to true to match the standardbinding.
                            // This setting on client has no effect for spnego and sslnego.
                            sspi.RequireCancellation = true;
                            sspi.InclusionMode = inclusionMode;
                            break;
                        }
                        else
                        {
                            parameters = null;
                        }
                    }
                }
                else
                {
                    parameters = new SspiSecurityTokenParameters();
                    parameters.RequireDerivedKeys = false;
                    parameters.InclusionMode = inclusionMode;
                }
            }

            return parameters != null;
        }
 public override XmlElement CreateWsspSpnegoContextTokenAssertion(MetadataExporter exporter, SspiSecurityTokenParameters parameters)
 {
     XmlElement result = CreateWsspAssertion(SpnegoContextTokenName);
     SetIncludeTokenValue(result, parameters.InclusionMode);
     result.AppendChild(
         CreateWspPolicyWrapper(
             exporter,
             CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys),
             // Always emit <sp:MustNotSendCancel/> for spnego and sslnego
             CreateWsspMustNotSendCancelAssertion(false),
             CreateWsspMustNotSendAmendAssertion(),
             CreateWsspMustNotSendRenewAssertion()
     ));
     return result;
 }