Compartir vía


ClientCredentials.Windows Propiedad

Definición

Obtiene un objeto usado para controlar las credenciales de Windows que el cliente usa para autenticarse en el servicio.

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

Valor de propiedad

que WindowsClientCredential representa la credencial actual de Windows.

Ejemplos

En el código siguiente se muestra cómo usar el objeto devuelto por esta propiedad para configurar el nivel de suplantación.

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

Comentarios

Puede usar el objeto devuelto por esta propiedad para configurar la credencial de Windows llamando a sus miembros, como AllowNtlm y AllowedImpersonationLevel.

Esta configuración controla la credencial de Windows usada durante la negociación de SPNEGO en el nivel de mensaje o transporte o en las propiedades de los tokens kerberos usados para la autenticación en el nivel de mensaje.

Se aplica a