Edit

Share via


SecurityMode Enum

Definition

Determines the security settings for a binding.

C#
public enum SecurityMode
Inheritance
SecurityMode

Fields

Name Value Description
None 0

Security is disabled.

Transport 1

Security is provided using a secure transport (for example, HTTPS).

Message 2

Security is provided using SOAP message security.

TransportWithMessageCredential 3

A secure transport (for example, HTTPS) provides integrity, confidentiality, and authentication while SOAP message security provides client authentication.

Examples

The following example sets the Mode property of the WSHttpBinding. For more examples, see How to: Set the Security Mode.

C#
WSHttpBinding b = new WSHttpBinding();
b.Security.Mode = SecurityMode.Transport;

Remarks

Any ProtectionLevel settings of a transport are ignored if the SecurityMode is set to None. For more information about the ProtectionLevel property, see Understanding Protection Level.

For more information about Windows Communication Foundation (WCF) security and how this property affects general security features, see Securing Services and Programming WCF Security. For more information about the transport mode, see Transport Security.

Note that if you choose TransportWithMessageCredential, then the value set in HttpClientCredentialType or TcpClientCredentialType is ignored.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0