Share via


X509ClientCertificateAuthentication.MapClientCertificateToWindowsAccount Vlastnost

Definice

Získá nebo nastaví hodnotu, která označuje, zda je certifikát mapován na účty systému 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

Hodnota vlastnosti

truepokud je certifikát mapován na účty Systému Windows; v opačném případě . false Výchozí formát je false.

Výjimky

set pokud jsou přihlašovací údaje jen pro čtení.

Příklady

Následující kód ukazuje, jak tuto vlastnost nastavit.

// 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

Vlastnost lze také nastavit v konfiguračním souboru.

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

Poznámky

Při použití typu přihlašovacích údajů klienta certifikátu na vazby se certifikát nemapuje na účty Systému Windows. Toto chování můžete přepsat pomocí této vlastnosti. Pokud je tato vlastnost nastavená na true, způsobí to mapování identity z klientského certifikátu na účet systému Windows.

Platí pro