Esempio n. 1
0
        protected ClientCredentials(ClientCredentials other)
        {
            if (other == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
            }
            if (other._userName != null)
            {
                _userName = new UserNamePasswordClientCredential(other._userName);
            }
            if (other._clientCertificate != null)
            {
                _clientCertificate = new X509CertificateInitiatorClientCredential(other._clientCertificate);
            }
            if (other._serviceCertificate != null)
            {
                _serviceCertificate = new X509CertificateRecipientClientCredential(other._serviceCertificate);
            }
            if (other._windows != null)
            {
                _windows = new WindowsClientCredential(other._windows);
            }
            if (other._httpDigest != null)
            {
                _httpDigest = new HttpDigestClientCredential(other._httpDigest);
            }

            _isReadOnly = other._isReadOnly;
        }
 internal void ApplyConfiguration(HttpDigestClientCredential digest)
 {
     if (digest == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("digest");
     }
     digest.AllowedImpersonationLevel = this.ImpersonationLevel;
 }
Esempio n. 3
0
 protected ClientCredentials(ClientCredentials other)
 {
     if (other == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
     }
     if (other._userName != null)
     {
         _userName = new UserNamePasswordClientCredential(other._userName);
     }
     if (other._httpDigest != null)
     {
         _httpDigest = new HttpDigestClientCredential(other._httpDigest);
     }
     _isReadOnly = other._isReadOnly;
 }
Esempio n. 4
0
        protected ClientCredentials(ClientCredentials other)
        {
            if (other == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
            }
            if (other.userName != null)
            {
                this.userName = new UserNamePasswordClientCredential(other.userName);
            }
            if (other.clientCertificate != null)
            {
                this.clientCertificate = new X509CertificateInitiatorClientCredential(other.clientCertificate);
            }
            if (other.serviceCertificate != null)
            {
                this.serviceCertificate = new X509CertificateRecipientClientCredential(other.serviceCertificate);
            }
            if (other.windows != null)
            {
                this.windows = new WindowsClientCredential(other.windows);
            }
            if (other.httpDigest != null)
            {
                this.httpDigest = new HttpDigestClientCredential(other.httpDigest);
            }
            if (other.issuedToken != null)
            {
                this.issuedToken = new IssuedTokenClientCredential(other.issuedToken);
            }
            if (other.peer != null)
            {
                this.peer = new PeerCredential(other.peer);
            }

            this.getInfoCardTokenCallback = other.getInfoCardTokenCallback;
            this.supportInteractive       = other.supportInteractive;
            this.securityTokenHandlerCollectionManager = other.securityTokenHandlerCollectionManager;
            this.useIdentityConfiguration = other.useIdentityConfiguration;
            this.isReadOnly = other.isReadOnly;
        }
Esempio n. 5
0
        private void Snippet1()
        {
            //<snippet1>
            // Create a service host.
            EndpointAddress ea = new EndpointAddress("http://localhost/Calculator");
            WSHttpBinding   b  = new WSHttpBinding(SecurityMode.Transport);

            b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Digest;

            // Create a client. The code is not shown here. See the WCF samples
            // for an example of the CalculatorClient code.

            CalculatorClient cc = new CalculatorClient(b, ea);
            // Get a reference to the Windows client credential object.
            HttpDigestClientCredential digestCred = cc.ClientCredentials.HttpDigest;

            Console.WriteLine("AllowedImpersonationLevel: {0}",
                              digestCred.AllowedImpersonationLevel);
            Console.WriteLine("Domain: {0}", digestCred.ClientCredential.Domain);

            Console.ReadLine();
            // Change the AllowedImpersonationLevel.
            digestCred.AllowedImpersonationLevel =
                System.Security.Principal.TokenImpersonationLevel.Impersonation;

            Console.WriteLine("Changed AllowedImpersonationLevel: {0}",
                              digestCred.AllowedImpersonationLevel);
            Console.ReadLine();
            // Open the calculator and use it.
            //cc.Open();
            //Console.WriteLine(cc.Add(11, 11));

            //// Close the client.
            //cc.Close();
            //</snippet1>
        }
Esempio n. 6
0
 public void HttpDigest()
 {
     ClientCredentials c = new ClientCredentials();
     // FIXME: implement
     HttpDigestClientCredential http = c.HttpDigest;
 }