Share via


X509ClientCertificateAuthentication.IncludeWindowsGroups プロパティ

定義

承認コンテキストに Windows グループが含まれるかどうかを示す値を取得または設定します。

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

プロパティ値

Boolean

Windows グループが承認コンテキストに含まれている場合は true、それ以外の場合は false。 既定値は、true です。

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

// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);
// Create a binding that uses a certificate.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
b.Security.Message.ClientCredentialType =
    MessageCredentialType.Certificate;

// 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 a certificate.
Dim b As New WSHttpBinding(SecurityMode.Message)
b.Security.Message.ClientCredentialType = MessageCredentialType.Certificate


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

プロパティは構成ファイル内でも設定できます。

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

注釈

このプロパティは、MapClientCertificateToWindowsAccount プロパティが true に設定されている場合にだけ有効です。

ユーザーが属するグループの一覧を生成する必要がない場合にのみ、このプロパティを false に設定します。アプリケーションや承認決定に Windows グループが不要な場合は、これによってパフォーマンスが向上する可能性があります。

適用対象