X509ClientCertificateAuthentication.MapClientCertificateToWindowsAccount Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta un valore che indica se il certificato è mappato agli account di 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
Valore della proprietà
true se il certificato è mappato agli account di Windows; in caso contrario, false. Il valore predefinito è false.
Eccezioni
set quando le credenziali sono di sola lettura.
Esempio
Nel codice seguente viene illustrato come impostare questa proprietà.
// 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
La proprietà può essere impostata anche in un file di configurazione.
<serviceCredentials>
<clientCertificate>
<authentication mapClientCertificateToWindowsAccount='true'/>
</clientCertificate>
</serviceCredentials>
Commenti
Quando si usa il tipo di credenziale client del certificato nelle associazioni, il certificato non viene mappato agli account di Windows. È possibile eseguire l'override di questo comportamento usando questa proprietà. Quando questa proprietà è impostata su true, determina il mapping dell'identità del certificato client a un account di Windows.