X509ClientCertificateAuthentication.MapClientCertificateToWindowsAccount Propriété

Définition

Obtient ou affecte une valeur qui indique si le certificat est mappé aux comptes Windows.

public:
 property bool MapClientCertificateToWindowsAccount { bool get(); void set(bool value); };
public bool MapClientCertificateToWindowsAccount { get; set; }
member this.MapClientCertificateToWindowsAccount : bool with get, set
Public Property MapClientCertificateToWindowsAccount As Boolean

Valeur de propriété

true si le certificat est mappé aux comptes Windows ; sinon, false. La valeur par défaut est false.

Exceptions

set lorsque les informations d'identification sont en lecture seule.

Exemples

Le code suivant montre comment définir cette propriété.

// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);

// Create a binding that uses Windows security.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
b.Security.Message.ClientCredentialType = MessageCredentialType.Windows;

// Get a reference to the authentication object.
X509ClientCertificateAuthentication myAuthProperties =
    sh.Credentials.ClientCertificate.Authentication;
// Configure IncludeWindowsGroups.
myAuthProperties.IncludeWindowsGroups = true;
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)

' Create a binding that uses Windows security.
Dim b As New WSHttpBinding(SecurityMode.Message)
b.Security.Message.ClientCredentialType = MessageCredentialType.Windows

' Get a reference to the authentication object.
Dim myAuthProperties As X509ClientCertificateAuthentication = _
sh.Credentials.ClientCertificate.Authentication
' Configure IncludeWindowsGroups.
myAuthProperties.IncludeWindowsGroups = True

Cette propriété peut également être définie dans un fichier de configuration.

<serviceCredentials>  
  <clientCertificate>  
     <authentication mapClientCertificateToWindowsAccount='true'/>  
  </clientCertificate>  
</serviceCredentials>  

Remarques

Lorsque le type d’informations d’identification du client de certificat est utilisé sur les liaisons, le certificat n’est pas mappé aux comptes Windows. Vous pouvez substituer ce comportement à l'aide de cette propriété. Lorsque cette propriété a la valeur true, elle entraîne le mappage de l'identité du certificat client à un compte Windows.

S’applique à