Export (0) Print
Expand All
Expand Minimize

MessageCredentialType Enumeration

Enumerates the valid message credential types.

Namespace:  System.ServiceModel
Assemblies:   System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)
  System.ServiceModel (in System.ServiceModel.dll)

public enum MessageCredentialType

Member nameDescription
CertificateSpecifies client authentication using a certificate.
IssuedTokenSpecifies client authentication using an issued token.
NoneSpecifies anonymous authentication.
UserNameSpecifies client authentication using UserName.
WindowsSpecifies client authentication using Windows.

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.

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");

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft