Expand Minimize

MessageCredentialType Enumeration

Enumerates the valid message credential types.

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

'Declaration
Public Enumeration MessageCredentialType
'Usage
Dim instance As MessageCredentialType

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

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.

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft