ClientCredentials.Windows Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém um objeto usado para controlar a credencial do Windows que o cliente usa para se autenticar ao serviço.
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 Propriedade
Um WindowsClientCredential que representa a credencial Windows atual.
Exemplos
O código seguinte mostra como usar o objeto devolvido por esta propriedade para configurar o nível de personificação.
// 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
Observações
Pode usar o objeto devolvido por esta propriedade para configurar a credencial Windows chamando os seus membros, como AllowNtlm e AllowedImpersonationLevel.
Estas definições controlam a credencial Windows usada durante a negociação do SPNEGO, seja ao nível da mensagem ou transporte, ou as propriedades dos tokens Kerberos usados para autenticação ao nível da mensagem.