X509ClientCertificateAuthentication.IncludeWindowsGroups Egenskap

Definition

Hämtar eller anger ett värde som anger om Windows grupper ingår i auktoriseringskontexten.

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

Egenskapsvärde

true om Windows grupper ingår i auktoriseringskontexten, annars false. Standardvärdet är true.

Exempel

Följande kod visar hur du anger den här egenskapen.

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

Egenskapen kan också anges i en konfigurationsfil.

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

Kommentarer

Den här egenskapen är endast giltig när egenskapen MapClientCertificateToWindowsAccount är inställd på true.

Ange den här egenskapen till false endast om du inte behöver upprätta listan över grupper som en användare tillhör . Detta kan resultera i en prestandaförmån om dina program- och auktoriseringsbeslut inte kräver Windows grupper.

Gäller för