HttpClientCredentialType 枚举

定义

枚举 HTTP 客户端的有效凭据类型。Enumerates the valid credential types for HTTP clients.

public enum class HttpClientCredentialType
public enum HttpClientCredentialType
type HttpClientCredentialType = 
Public Enum HttpClientCredentialType
继承
HttpClientCredentialType

字段

Basic 1

指定基本身份验证。Specifies Basic authentication. 有关详细信息,请参阅 RFC 2617 - HTTP 身份验证:基本和摘要式身份验证For more information, see RFC 2617 - HTTP Authentication: Basic and Digest Authentication.

Certificate 5

指定使用证书进行客户端身份验证。Specifies client authentication using a certificate.

Digest 2

指定摘要式身份验证。Specifies Digest authentication. 有关详细信息,请参阅 RFC 2617 - HTTP 身份验证:基本和摘要式身份验证For more information, see RFC 2617 - HTTP Authentication: Basic and Digest Authentication.

InheritedFromHost 6

身份验证继承自主机。The authentication is inherited from the host.

None 0

指定匿名身份验证。Specifies anonymous authentication.

Ntlm 3

指定使用 NTLM 进行客户端身份验证。Specifies client authentication using NTLM.

Windows 4

指定使用 Windows 进行客户端身份验证。Specifies client authentication using Windows.

示例

下面的代码演示如何将 ClientCredentialType 设置为此枚举的成员。The following code shows how to set ClientCredentialType to a member of this enumeration.

// The code uses a shortcut to specify the security mode to Transport.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Transport);
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
' The code uses a shortcut to specify the security mode to Transport.
Dim b As WSHttpBinding = New WSHttpBinding(SecurityMode.Transport)
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows

注解

此枚举由 ClientCredentialType 用来指定要用于身份验证的客户端凭据类型。This enumeration is used by ClientCredentialType to specify the type of client credential to be used for authentication.

注意,如果 SecurityMode 设置为 TransportWithMessageCredential,将忽略 HttpClientCredentialType 的值。Note that if SecurityMode is set to TransportWithMessageCredential, then the value of HttpClientCredentialType is ignored.

适用于