Auf Englisch lesen Bearbeiten

Freigeben über


MessageCredentialType Enum

Definition

Enumerates the valid message credential types.

public enum MessageCredentialType
Inheritance
MessageCredentialType

Fields

Name Value Description
None 0

Specifies anonymous authentication.

Windows 1

Specifies client authentication using Windows.

UserName 2

Specifies client authentication using UserName.

Certificate 3

Specifies client authentication using a certificate.

IssuedToken 4

Specifies client authentication using an issued token.

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

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

Produkt Versionen
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0