BasicHttpSecurityMode Enumeration

Specifies the types of security that can be used with the system-provided BasicHttpBinding binding.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public enum BasicHttpSecurityMode

Member nameDescription
Supported by Silverlight for Windows PhoneNoneThe SOAP message is not secured during transfer. This is the default behavior.
Supported by Silverlight for Windows PhoneTransportSecurity is provided using HTTPS. The service must be configured with SSL certificates. The SOAP message is protected as a whole using HTTPS. The service is authenticated by the client using the service’s SSL certificate.
Supported by Silverlight for Windows PhoneTransportWithMessageCredentialThis mode provides integrity, confidentiality, and server authentication using HTTPS. The service must be configured with a certificate. Client authentication is provided by SOAP message security.

This mode is applicable when the user is authenticating with a UserName or Certificate credential and there is an existing HTTPS deployment for securing message transfer.

Supported by Silverlight for Windows PhoneTransportCredentialOnlyThis mode provides only HTTP-based client authentication. It does not provide message integrity or confidentiality.

The default behavior for BasicHttpBinding is None. To specify another value, use the BasicHttpBinding(BasicHttpSecurityMode) constructor.

            //Constructors set with different security modes
            PollingDuplexHttpBinding defaultNoSecurityPDBinding = new PollingDuplexHttpBinding();
            PollingDuplexHttpBinding transportSecurityPDBinding = new PollingDuplexHttpBinding(BasicHttpSecurityMode.Transport);
            PollingDuplexHttpBinding transportCredentialOnlyPDBinding = new PollingDuplexHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);

            //Get the BasicHttpSecurity from the binding
            BasicHttpSecurity defaultSecurity = defaultNoSecurityPDBinding.Security;
            BasicHttpSecurity transportHttpSecurity = transportSecurityPDBinding.Security;
            BasicHttpSecurity transportCredentialOnlyHttpSecurity = transportCredentialOnlyPDBinding.Security;

            //Get the defaultSecurityMode
            BasicHttpSecurityMode defaultSecurityMode = defaultSecurity.Mode;

            //Output for binding with no security: None
            string txtdefaultSecurityMode = defaultSecurityMode.ToString();

            //Get the transportSecurityMode
            BasicHttpSecurityMode tansportSecurityMode = transportHttpSecurity.Mode;

            //Output for binding with transport security: Transport
            string txtTransportSecurityMode = tansportSecurityMode.ToString();

            //Output txtSecurityMode for binding with transport credential security: TransportCredentialOnly
            string txtTransportCredentialOnlySecurityMode = transportCredentialOnlyHttpSecurity.Mode.ToString();

            //Change the SecurityMode for a binding
            defaultSecurityMode = BasicHttpSecurityMode.TransportCredentialOnly;

            //Output for binding with transport credential only security: TransportCredentialOnly
            string txtChangedSecurityMode = defaultSecurityMode.ToString();


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions