HttpTransportBindingElement.UnsafeConnectionNtlmAuthentication Property

Definition

Gets or sets a value that indicates whether Unsafe Connection Sharing is enabled on the server. If enabled, NTLM authentication is performed once on each TCP connection.

C#
public bool UnsafeConnectionNtlmAuthentication { get; set; }

Property Value

true if Unsafe Connection Sharing is enabled; otherwise, false. The default is false.

Examples

The following example sets the property to enable Unsafe Connection Sharing.

C#
HttpTransportBindingElement httpBinding = new HttpTransportBindingElement();  
httpBinding.AuthenticationScheme = AuthenticationSchemes.Ntlm;  
httpBinding.UnsafeConnectionNtlmAuthentication = true;  

Remarks

When this property is set to true and the first request over a particular connection is authenticated using NTLM, subsequent requests over the same connection are processed using the authentication information in IIdentity of the initial request.

This property has no effect when NTLM is not the authentication protocol.

Huomautus

While setting this property to true increases performance because additional NTLM authentication challenges are not sent, there is a security risk in not requiring all requests to provide authentication information. You must determine whether the increase in performance is worth this risk.

For more information, see UnsafeConnectionNtlmAuthentication.

Applies to

Tuote Versiot
.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, 4.7.1, 4.7.2, 4.8, 4.8.1