Leer en inglés Editar

Compartir a través de


MessageCredentialType Enum

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Enumerates the valid message credential types.

C#
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.

C#
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

Producto Versiones
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (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, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0