HttpTransportBindingElement.UnsafeConnectionNtlmAuthentication 屬性

定義

取得或設定值,指出伺服器上是否啟用不安全的連線共用。 如果已啟用,NTLM 驗證會在各 TCP 連線上執行一次。

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

屬性值

如果已啟用不安全的連線共用,則為 true,否則為 false。 預設為 false

範例

下列範例會設定此屬性,以啟用不安全的連線共用。

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

備註

當這個屬性設為 true,且使用 NTLM 驗證特定連線上的第一個要求時,在相同連線上的後續要求都會使用初始要求 IIdentity 中的驗證資訊進行處理。

當 NTLM 不是驗證通訊協定時,這個屬性不會有任何作用。

注意

雖然將這個屬性設為 true 可以提高效能,因為不會傳送其他 NTLM 驗證挑戰,但是不要求所有要求提供驗證資訊會有安全性風險。 您必須決定是否值得冒這個風險以提升效能。

如需詳細資訊,請參閱UnsafeConnectionNtlmAuthentication

適用於