WebHttpSecurityMode 列舉


定義可用來將服務端點設定為接收 HTTP 要求的安全性模式。Defines the modes of security that can be used to configure a service endpoint to receive HTTP requests.

public enum class WebHttpSecurityMode
public enum WebHttpSecurityMode
type WebHttpSecurityMode = 
Public Enum WebHttpSecurityMode


None 0

表示 HTTP 要求未搭配使用任何安全性。Indicates no security is used with HTTP requests.

Transport 1

表示傳輸層級安全性搭配 HTTP 要求一起使用。Indicates that transport-level security is used with HTTP requests.

TransportCredentialOnly 2

表示只提供 HTTP 架構的用戶端驗證。Indicates that only HTTP-based client authentication is provided.


您可以使用這個列舉指定傳輸層級安全性是否由以 WebHttpBinding 設定的端點用來接收 HTTP 要求。Use this enumeration to specify whether transport-level security is used by an endpoint configured with a WebHttpBinding to receive HTTP requests. 預設值為 [無],表示不會使用任何安全性。The default value is None, which indicates that no security is used.

如果指定了傳輸值 WebHttpBinding(WebHttpSecurityMode) ,則屬性提供的設定 Transport 就會變成有效的服務端點。If the Transport value is specified by the WebHttpBinding(WebHttpSecurityMode), then the settings provided by the Transport property become effective for the service endpoint. WebHttpSecurityMode 的值只能在 WebHttpBinding 建構函式中設定,這個建構函式會將它當做明確參數,而且其值在建立繫結執行個體之後無法再次設定。The value of WebHttpSecurityMode can only be set in the WebHttpBinding constructor that takes it as an explicit parameter and its value cannot be set again after the binding instance is created.

TransportCredentialOnly 不提供訊息完整性和機密性。TransportCredentialOnly does not provide message integrity and confidentiality. 只會提供 HTTP 架構的用戶端驗證。It provides HTTP-based client authentication only. 請謹慎使用這個模式,This mode should be used with caution. 它應該用於 IPSec 之類的環境,其中的傳輸安全性是由其他方法提供,而且只有 Windows Communication Foundation (WCF)基礎結構提供用戶端驗證。It should be used in environments, such at IPSec, where the transport security is being provided by other means and only client authentication is provided by the Windows Communication Foundation (WCF) infrastructure.