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

プロパティ値

証明書が Windows アカウントにマッピングされている場合は true、それ以外の場合は 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 アカウントにマッピングされます。

適用対象