MessageCredentialType MessageCredentialType MessageCredentialType MessageCredentialType Enum

Definition

Enumerates the valid message credential types.

public enum class MessageCredentialType
public enum MessageCredentialType
type MessageCredentialType = 
Public Enum MessageCredentialType
Inheritance
MessageCredentialTypeMessageCredentialTypeMessageCredentialTypeMessageCredentialType

Fields

Certificate Certificate Certificate Certificate 3

Specifies client authentication using a certificate.

IssuedToken IssuedToken IssuedToken IssuedToken 4

Specifies client authentication using an issued token.

None None None None 0

Specifies anonymous authentication.

UserName UserName UserName UserName 2

Specifies client authentication using UserName.

Windows Windows Windows Windows 1

Specifies client authentication using Windows.

Examples

The following code shows how to access and set ClientCredentialType to a member of this enumeration.

ServiceHost myServiceHost = new ServiceHost(typeof(CalculatorService));
// Create a binding to use.
WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
    MessageCredentialType.Certificate;

// Set the client certificate.
myServiceHost.Credentials.ClientCertificate.SetCertificate(
    StoreLocation.CurrentUser,
    StoreName.My,
    X509FindType.FindBySubjectName,
    "client.com");
Dim myServiceHost As New ServiceHost(GetType(CalculatorService))
' Create a binding to use.
Dim binding As New WSHttpBinding()
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.ClientCredentialType = _
MessageCredentialType.Certificate

' Set the client certificate.
myServiceHost.Credentials.ClientCertificate.SetCertificate( _
        StoreLocation.CurrentUser, _
        StoreName.My, _
        X509FindType.FindBySubjectName, _
        "client.com")

Remarks

This enumeration is used to specify the credential type required by a binding for authentication. It is used by all standard bindings except the BasicHttpBinding, which uses BasicHttpMessageCredentialType.

Applies to