X509ClientCertificateAuthentication.IncludeWindowsGroups Vlastnost

Definice

Získá nebo nastaví hodnotu, která označuje, zda jsou skupiny Windows zahrnuty do autorizačního kontextu.

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

Hodnota vlastnosti

Boolean

truepokud jsou skupiny Windows zahrnuty v kontextu autorizace; jinak false. Výchozí formát je true.

Příklady

Následující kód ukazuje, jak nastavit tuto vlastnost.

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

Vlastnost lze také nastavit v konfiguračním souboru.

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

Poznámky

Tato vlastnost je platná pouze v případě, že MapClientCertificateToWindowsAccount je vlastnost nastavena na true.

Tuto vlastnost nastavte false jenom v případě, že nepotřebujete vytvořit seznam skupin, do kterých uživatel patří – to může mít za následek výhodu výkonu, pokud vaše aplikace a autorizační rozhodnutí nevyžadují skupiny Windows.

Platí pro