X509ClientCertificateAuthentication.IncludeWindowsGroups Eigenschap

Definitie

Hiermee wordt een waarde opgehaald of ingesteld die aangeeft of Windows groepen zijn opgenomen in de autorisatiecontext.

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

Waarde van eigenschap

true als Windows groepen zijn opgenomen in de autorisatiecontext; anders false. De standaardwaarde is true.

Voorbeelden

De volgende code laat zien hoe u deze eigenschap instelt.

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

De eigenschap kan ook worden ingesteld in een configuratiebestand.

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

Opmerkingen

Deze eigenschap is alleen geldig wanneer de MapClientCertificateToWindowsAccount eigenschap is ingesteld op true.

Stel deze eigenschap alleen in op false als u de lijst met groepen waartoe een gebruiker behoort niet hoeft in te stellen. Dit kan leiden tot een prestatievoordeel als uw toepassings- en autorisatiebeslissingen geen Windows groepen nodig hebben.

Van toepassing op