Пример #1
0
        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from);
            ClientCredentialsElement element = (ClientCredentialsElement)from;

            this.ClientCertificate.Copy(element.ClientCertificate);
            this.ServiceCertificate.Copy(element.ServiceCertificate);
            this.Windows.Copy(element.Windows);
            this.IssuedToken.Copy(element.IssuedToken);
            this.HttpDigest.Copy(element.HttpDigest);
            this.Peer.Copy(element.Peer);
            this.SupportInteractive = element.SupportInteractive;
            this.Type = element.Type;
        }
        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from);

            ClientCredentialsElement source = (ClientCredentialsElement)from;

#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
            this.ClientCertificate.Copy(source.ClientCertificate);
            this.ServiceCertificate.Copy(source.ServiceCertificate);
            this.Windows.Copy(source.Windows);
            this.IssuedToken.Copy(source.IssuedToken);
            this.HttpDigest.Copy(source.HttpDigest);
            this.Peer.Copy(source.Peer);
            this.SupportInteractive = source.SupportInteractive;
            this.Type = source.Type;
            this.UseIdentityConfiguration = source.UseIdentityConfiguration;
        }
Пример #3
0
        public override void CopyFrom(ServiceModelExtensionElement from)
        {
            base.CopyFrom(from);

            ClientCredentialsElement source = (ClientCredentialsElement)from;

            this.ClientCertificate.Copy(source.ClientCertificate);
            this.ServiceCertificate.Copy(source.ServiceCertificate);
            this.Windows.Copy(source.Windows);
#if DESKTOP
            this.IssuedToken.Copy(source.IssuedToken);
#endif
            this.HttpDigest.Copy(source.HttpDigest);
#if DESKTOP
            this.Peer.Copy(source.Peer);
#endif
            this.SupportInteractive = source.SupportInteractive;
            this.Type = source.Type;
            this.UseIdentityConfiguration = source.UseIdentityConfiguration;
        }
Пример #4
0
		public void ClientCredentialsElement_defaults () {
			ClientCredentialsElement element = new ClientCredentialsElement ();

			Assert.AreEqual (typeof (ClientCredentials), element.BehaviorType, "BehaviorType");
			Assert.AreEqual ("clientCredentials", element.ConfigurationElementName, "ConfigurationElementName");

			Assert.AreEqual (true, element.SupportInteractive, "SupportInteractive");
			Assert.AreEqual (String.Empty, element.Type, "Type");

			Assert.AreEqual (String.Empty, element.ClientCertificate.FindValue, "ClientCertificate.FindValue");
			Assert.AreEqual (StoreLocation.CurrentUser, element.ClientCertificate.StoreLocation, "ClientCertificate.StoreLocation");
			Assert.AreEqual (StoreName.My, element.ClientCertificate.StoreName, "ClientCertificate.StoreName");
			Assert.AreEqual (X509FindType.FindBySubjectDistinguishedName, element.ClientCertificate.X509FindType, "ClientCertificate.X509FindType");

			Assert.AreEqual (String.Empty, element.ServiceCertificate.DefaultCertificate.FindValue, "ServiceCertificate.DefaultCertificate.FindValue");
			Assert.AreEqual (StoreLocation.CurrentUser, element.ServiceCertificate.DefaultCertificate.StoreLocation, "ServiceCertificate.DefaultCertificate.StoreLocation");
			Assert.AreEqual (StoreName.My, element.ServiceCertificate.DefaultCertificate.StoreName, "ServiceCertificate.DefaultCertificate.StoreName");
			Assert.AreEqual (X509FindType.FindBySubjectDistinguishedName, element.ServiceCertificate.DefaultCertificate.X509FindType, "ServiceCertificate.DefaultCertificate.X509FindType");

			Assert.AreEqual (String.Empty, element.ServiceCertificate.Authentication.CustomCertificateValidatorType, "ServiceCertificate.Authentication.CustomCertificateValidatorType");
			Assert.AreEqual (X509CertificateValidationMode.ChainTrust, element.ServiceCertificate.Authentication.CertificateValidationMode, "ServiceCertificate.Authentication.CertificateValidationMode");
			Assert.AreEqual (X509RevocationMode.Online, element.ServiceCertificate.Authentication.RevocationMode, "ServiceCertificate.Authentication.RevocationMode");
			Assert.AreEqual (StoreLocation.CurrentUser, element.ServiceCertificate.Authentication.TrustedStoreLocation, "ServiceCertificate.Authentication.TrustedStoreLocation");

			Assert.AreEqual (true, element.Windows.AllowNtlm, "Windows.AllowNtlm");
			Assert.AreEqual (TokenImpersonationLevel.Identification, element.Windows.AllowedImpersonationLevel, "Windows.AllowedImpersonationLevel");

			Assert.AreEqual (true, element.IssuedToken.CacheIssuedTokens, "IssuedToken.CacheIssuedTokens");
			Assert.AreEqual (SecurityKeyEntropyMode.CombinedEntropy, element.IssuedToken.DefaultKeyEntropyMode, "IssuedToken.DefaultKeyEntropyMode");
			Assert.AreEqual (60, element.IssuedToken.IssuedTokenRenewalThresholdPercentage, "IssuedToken.IssuedTokenRenewalThresholdPercentage");

			Assert.AreEqual (TokenImpersonationLevel.Identification, element.HttpDigest.ImpersonationLevel, "HttpDigest.ImpersonationLevel");
		}