X509ClientCertificateAuthentication.MapClientCertificateToWindowsAccount プロパティ

定義

証明書が 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

プロパティ値

true 証明書が Windows アカウントにマップされている場合。それ以外の場合は false。 既定値は false です。

例外

set 資格情報が読み取り専用の場合。

次のコードは、このプロパティを設定する方法を示しています。

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

このプロパティは、構成ファイルで設定することもできます。

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

注釈

バインドで証明書クライアント資格情報の種類を使用する場合、証明書は Windows アカウントにマップされません。 この動作は、このプロパティを使用してオーバーライドできます。 このプロパティを true に設定すると、クライアント証明書の ID が Windows アカウントにマップされます。

適用対象