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.
public enum class MessageCredentialType
public enum MessageCredentialType
type MessageCredentialType =
Public Enum MessageCredentialType
- Inheritance
Fields
Certificate | 3 | Specifies client authentication using a certificate. |
IssuedToken | 4 | Specifies client authentication using an issued token. |
None | 0 | Specifies anonymous authentication. |
UserName | 2 | Specifies client authentication using UserName. |
Windows | 1 | Specifies client authentication using Windows. |
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");
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")
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기