Share via


ClientCredentials.Windows Propriété

Définition

Obtient un objet utilisé pour déterminer les informations d'identification Windows dont le client se sert pour s'authentifier auprès du service.

public:
 property System::ServiceModel::Security::WindowsClientCredential ^ Windows { System::ServiceModel::Security::WindowsClientCredential ^ get(); };
public System.ServiceModel.Security.WindowsClientCredential Windows { get; }
member this.Windows : System.ServiceModel.Security.WindowsClientCredential
Public ReadOnly Property Windows As WindowsClientCredential

Valeur de propriété

WindowsClientCredential qui représente les informations d'identification Windows actuelles.

Exemples

Le code suivant indique comment utiliser l'objet retourné par cette propriété pour configurer le niveau de représentation.

  // Create a client object with the given client endpoint configuration.
 CalculatorClient client = new CalculatorClient();
try
  {
      client.ClientCredentials.Windows.AllowedImpersonationLevel
          = TokenImpersonationLevel.Impersonation;
  }
  catch (TimeoutException timeProblem)
  {
    Console.WriteLine("The service operation timed out. " + timeProblem.Message);
    Console.ReadLine();
    client.Abort();
  }
  catch (CommunicationException commProblem)
  {
    Console.WriteLine("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
    Console.ReadLine();
    client.Abort();
  }
  ' Create a client object with the given client endpoint configuration.
 Dim client As New CalculatorClient()
Try
      client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation
  Catch timeProblem As TimeoutException
    Console.WriteLine("The service operation timed out. " & timeProblem.Message)
    Console.ReadLine()
    client.Abort()
  Catch commProblem As CommunicationException
    Console.WriteLine("There was a communication problem. " & commProblem.Message + commProblem.StackTrace)
    Console.ReadLine()
    client.Abort()
  End Try

Remarques

Vous pouvez utiliser l'objet retourné par cette propriété pour configurer les informations d'identification Windows en appelant ses membres, comme AllowNtlm et AllowedImpersonationLevel.

Ces paramètres déterminent les informations d'identification Windows utilisées lors de la négociation SPNEGO au niveau du message ou du transport ou les propriétés des jetons Kerberos utilisés pour l'authentification au niveau du message.

S’applique à