HttpTransportBindingElement.UnsafeConnectionNtlmAuthentication 属性

定义

获取或设置一个值,该值指示是否在服务器上启用不安全连接共享。Gets or sets a value that indicates whether Unsafe Connection Sharing is enabled on the server. 如果启用,将对每个 TCP 连接执行一次 NTLM 身份验证。If enabled, NTLM authentication is performed once on each TCP connection.

public:
 property bool UnsafeConnectionNtlmAuthentication { bool get(); void set(bool value); };
public bool UnsafeConnectionNtlmAuthentication { get; set; }
member this.UnsafeConnectionNtlmAuthentication : bool with get, set
Public Property UnsafeConnectionNtlmAuthentication As Boolean

属性值

Boolean

如果启用不安全连接共享,则为 true;否则为 falsetrue if Unsafe Connection Sharing is enabled; otherwise, false. 默认值为 falseThe default is false.

示例

下面的示例设置该属性以启用不安全连接共享。The following example sets the property to enable Unsafe Connection Sharing.

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

注解

如果将此属性设置为 true 且使用 NTLM 对特定连接上的第一个请求进行身份验证,则会使用初始请求 IIdentity 中的身份验证信息来处理同一连接上的后续请求。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.

此属性在 NTLM 不是身份验证协议时无效。This property has no effect when NTLM is not the authentication protocol.

备注

将此属性设置为 true 时不会发送其他 NTLM 身份验证质询,因此会提高性能,但是由于不要求所有请求都提供身份验证信息,所以存在安全风险。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.

有关详细信息,请参阅 UnsafeConnectionNtlmAuthenticationFor more information, see UnsafeConnectionNtlmAuthentication.

适用于