BasicHttpMessageCredentialType Enumeration
TOC
Collapse the table of content
Expand the table of content

BasicHttpMessageCredentialType Enumeration

 

Enumerates credential types the client can authenticate with when security is enabled in the BasicHttpBinding binding.

Namespace:   System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public enum BasicHttpMessageCredentialType

Member nameDescription
Certificate

Indicates that a client be authenticated using a certificate.

UserName

Indicates that the client be authenticated using a username credential.

If Mode is configured to perform client authentication at the message level, this enumeration controls the client credential type. Both username and X.509 certificate to use must be provisioned through an IEndpointBehavior instance which implements the SecurityCredentialsManager extensibility point; in a common default case this is ClientCredentials.

The client credential in the certificate case must be specified using the ClientCertificate property of the ClientCredentials class.

The client credential in the username case must be specified using the UserName property of the ClientCredentials class.

In addition, when message security mode is used, the client must be provisioned with the service's certificate. The service credential in this case must be specified using the ServiceCertificate property on the ClientCredentials class.

The following configuration file snippets illustrates how to specify BasicHttpMessageCredentialType:

The important sections are:

The bindings section where we specify the security mode (Message) and the type of credential that will be used to authenticate the client:

The behaviors section where we specify the certificate to use for service authentication and the method for validating the client certificate:

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft