次の方法で共有


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

プロパティ値

true Windows グループが承認コンテキストに含まれている場合。それ以外の場合は 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 グループが必要ない場合は、パフォーマンス上の利点が得られる可能性があります。

適用対象