NegotiateStream.BeginAuthenticateAsClient Méthode

Définition

Commence une opération asynchrone pour authentifier le côté client d'une connexion client-serveur.

Surcharges

BeginAuthenticateAsClient(AsyncCallback, Object)

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Cette méthode ne provoque pas de blocage.

BeginAuthenticateAsClient(NetworkCredential, String, AsyncCallback, Object)

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification spécifiées. Cette méthode ne provoque pas de blocage.

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, AsyncCallback, Object)

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification et la liaison de canal spécifiées. Cette méthode ne provoque pas de blocage.

BeginAuthenticateAsClient(NetworkCredential, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les options d'authentification et les informations d'identification spécifiées. Cette méthode ne provoque pas de blocage.

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification, les options d'authentification et la liaison de canal spécifiées. Cette méthode ne provoque pas de blocage.

Remarques

Les surcharges de cette méthode ne bloquent pas tant que l’authentification est en cours. Pour bloquer en attendant la fin de l’authentification, utilisez l’une AuthenticateAsClient des méthodes .

BeginAuthenticateAsClient(AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Cette méthode ne provoque pas de blocage.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

asyncCallback
AsyncCallback

Délégué AsyncCallback qui fait référence à la méthode à appeler quand l’authentification est terminée.

asyncState
Object

Objet défini par l'utilisateur comportant des informations sur l'opération. Cet objet est passé au délégué asyncCallback quand l'opération se termine.

Retours

Objet IAsyncResult indiquant l'état de l'opération asynchrone.

Exceptions

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L’objet a été fermé.

L’authentification a déjà eu lieu.

- ou -

Ce flux a été utilisé précédemment pour tenter d'effectuer l'authentification en tant que serveur. Vous ne pouvez pas utiliser le flux pour faire une nouvelle tentative d'authentification en tant que client.

Exemples

L’exemple suivant illustre l’appel de cette méthode pour commencer une authentification asynchrone pour le client.

// Establish the remote endpoint for the socket.
// For this example, use the local machine.
IPHostEntry^ ipHostInfo = Dns::GetHostEntry( Dns::GetHostName() );
IPAddress^ ipAddress = ipHostInfo->AddressList[ 0 ];

// Client and server use port 11000. 
IPEndPoint^ remoteEP = gcnew IPEndPoint( ipAddress,11000 );

// Create a TCP/IP socket.
client = gcnew TcpClient;

// Connect the socket to the remote endpoint.
client->Connect( remoteEP );
Console::WriteLine( L"Client connected to {0}.", remoteEP );

// Ensure the client does not close when there is 
// still data to be sent to the server.
client->LingerState = (gcnew LingerOption( true,0 ));

// Request authentication.
NetworkStream^ clientStream = client->GetStream();
NegotiateStream^ authStream = gcnew NegotiateStream( clientStream,false );

// Pass the NegotiateStream as the AsyncState object 
// so that it is available to the callback delegate.
IAsyncResult^ ar = authStream->BeginAuthenticateAsClient( gcnew AsyncCallback( EndAuthenticateCallback ), authStream );

// Establish the remote endpoint for the socket.
// For this example, use the local machine.
IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost");
IPAddress ipAddress = ipHostInfo.AddressList[0];
// Client and server use port 11000.
IPEndPoint remoteEP = new IPEndPoint(ipAddress, 11000);
// Create a TCP/IP socket.
client = new TcpClient();
// Connect the socket to the remote endpoint.
client.Connect(remoteEP);
Console.WriteLine("Client connected to {0}.", remoteEP.ToString());
// Ensure the client does not close when there is
// still data to be sent to the server.
client.LingerState = new LingerOption(true, 0);
// Request authentication.
NetworkStream clientStream = client.GetStream();
NegotiateStream authStream = new NegotiateStream(clientStream, false);
// Pass the NegotiateStream as the AsyncState object
// so that it is available to the callback delegate.
Task authenticateTask = authStream
    .AuthenticateAsClientAsync()
    .ContinueWith(task =>
    {
        Console.WriteLine("Client ending authentication...");
        Console.WriteLine("ImpersonationLevel: {0}", authStream.ImpersonationLevel);
    });

' Establish the remote endpoint for the socket.
' For this example, use the local machine.
Dim ipHostInfo = Dns.GetHostEntry("localhost")
Dim ipAddress = ipHostInfo.AddressList(0)

' Client and server use port 11000. 
Dim remoteEP As New IPEndPoint(ipAddress, 11000)

' Create a TCP/IP socket.
client = New TcpClient()

' Connect the socket to the remote endpoint.
client.Connect(remoteEP)
Console.WriteLine("Client connected to {0}.", remoteEP.ToString())

' Ensure the client does not close when there is 
' still data to be sent to the server.
client.LingerState = (New LingerOption(True, 0))

' Request authentication.
Dim clientStream = client.GetStream()
Dim authStream As New NegotiateStream(clientStream, False)

' Pass the NegotiateStream as the AsyncState object 
' so that it is available to the callback delegate.
Dim ar = authStream.BeginAuthenticateAsClient(
    New AsyncCallback(AddressOf EndAuthenticateCallback), authStream)

Remarques

L’authentification utilise le client DefaultCredentials. Aucun nom de principal de service (SPN) n’est spécifié pour le serveur. Le niveau d’emprunt d’identité est Identification, et le niveau de sécurité est EncryptAndSign. La NegotiateStream classe construit le SPN utilisé pour l’authentification mutuelle.

Cette méthode est asynchrone et ne se bloque pas tant que l’opération se termine. Pour bloquer jusqu’à la fin de l’opération, utilisez l’une AuthenticateAsClient des surcharges de méthode.

L’opération d’authentification asynchrone doit être effectuée en appelant la EndAuthenticateAsClient méthode . En règle générale, la méthode est appelée par le asyncCallback délégué. Pour plus d’informations sur l’utilisation du modèle de programmation asynchrone, consultez Appel de méthodes synchrones de manière asynchrone

Si l’authentification échoue, vous recevez un AuthenticationException ou un InvalidCredentialException. Dans ce cas, vous pouvez réessayer l’authentification avec des informations d’identification différentes.

S’applique à

BeginAuthenticateAsClient(NetworkCredential, String, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification spécifiées. Cette méthode ne provoque pas de blocage.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::String ^ targetName, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * string * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * string * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, targetName As String, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

credential
NetworkCredential

NetworkCredential utilisé pour établir l'identité du client.

targetName
String

Nom de principal du service (SPN) qui identifie de manière unique le serveur à authentifier.

asyncCallback
AsyncCallback

Délégué AsyncCallback qui fait référence à la méthode à appeler quand l’authentification est terminée.

asyncState
Object

Objet défini par l'utilisateur comportant des informations sur l'opération d'écriture. Cet objet est passé au délégué asyncCallback quand l'opération se termine.

Retours

Objet IAsyncResult indiquant l'état de l'opération asynchrone.

Exceptions

credential a la valeur null.

-ou-

targetName a la valeur null.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L’objet a été fermé.

L’authentification a déjà eu lieu.

- ou -

Ce flux a été utilisé précédemment pour tenter d'effectuer l'authentification en tant que serveur. Vous ne pouvez pas utiliser le flux pour faire une nouvelle tentative d'authentification en tant que client.

Remarques

Cette méthode est asynchrone et ne se bloque pas tant que l’opération se termine. Pour bloquer jusqu’à la fin de l’opération, utilisez l’une AuthenticateAsClient des surcharges de méthode.

L’opération d’authentification asynchrone doit être effectuée en appelant la EndAuthenticateAsClient méthode . En règle générale, la méthode est appelée par le asyncCallback délégué. Pour plus d’informations sur l’utilisation du modèle de programmation asynchrone, consultez Appel de méthodes synchrones de manière asynchrone

Si l’authentification échoue, vous recevez un AuthenticationException ou un InvalidCredentialException. Dans ce cas, vous pouvez réessayer l’authentification avec des informations d’identification différentes.

S’applique à

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification et la liaison de canal spécifiées. Cette méthode ne provoque pas de blocage.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::Security::Authentication::ExtendedProtection::ChannelBinding ^ binding, System::String ^ targetName, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding? binding, string targetName, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding binding, string targetName, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, binding As ChannelBinding, targetName As String, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

credential
NetworkCredential

NetworkCredential utilisé pour établir l'identité du client.

binding
ChannelBinding

ChannelBinding qui est utilisé comme protection étendue.

targetName
String

Nom de principal du service (SPN) qui identifie de manière unique le serveur à authentifier.

asyncCallback
AsyncCallback

Délégué AsyncCallback qui fait référence à la méthode à appeler quand l’authentification est terminée.

asyncState
Object

Objet défini par l'utilisateur comportant des informations sur l'opération d'écriture. Cet objet est passé au délégué asyncCallback quand l'opération se termine.

Retours

Objet IAsyncResult indiquant l'état de l'opération asynchrone.

Exceptions

credential a la valeur null.

-ou-

targetName a la valeur null.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L’authentification a déjà eu lieu.

- ou -

Ce flux a été utilisé précédemment pour tenter d'effectuer l'authentification en tant que serveur. Vous ne pouvez pas utiliser le flux pour faire une nouvelle tentative d'authentification en tant que client.

L’objet a été fermé.

Remarques

Cette méthode est asynchrone et ne bloque pas tant que l’opération se termine. Pour bloquer jusqu’à la fin de l’opération, utilisez l’une AuthenticateAsClient des surcharges de méthode.

L’opération d’authentification asynchrone doit être effectuée en appelant la EndAuthenticateAsClient méthode . En règle générale, la méthode est appelée par le asyncCallback délégué. Pour plus d’informations sur l’utilisation du modèle de programmation asynchrone, consultez Appel de méthodes synchrones de manière asynchrone

Si l’authentification échoue, vous recevez un AuthenticationException ou un InvalidCredentialException. Dans ce cas, vous pouvez réessayer l’authentification avec des informations d’identification différentes.

Voir aussi

S’applique à

BeginAuthenticateAsClient(NetworkCredential, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les options d'authentification et les informations d'identification spécifiées. Cette méthode ne provoque pas de blocage.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::String ^ targetName, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, targetName As String, requiredProtectionLevel As ProtectionLevel, allowedImpersonationLevel As TokenImpersonationLevel, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

credential
NetworkCredential

NetworkCredential utilisé pour établir l'identité du client.

targetName
String

Nom de principal du service (SPN) qui identifie de manière unique le serveur à authentifier.

requiredProtectionLevel
ProtectionLevel

L'une des valeurs ProtectionLevel, indiquant les services de sécurité pour le flux.

allowedImpersonationLevel
TokenImpersonationLevel

L'une des valeurs TokenImpersonationLevel, indiquant comment le serveur peut utiliser les informations d'identification du client pour accéder aux ressources.

asyncCallback
AsyncCallback

Délégué AsyncCallback qui fait référence à la méthode à appeler quand l’authentification est terminée.

asyncState
Object

Objet défini par l'utilisateur comportant des informations sur l'opération d'écriture. Cet objet est passé au délégué asyncCallback quand l'opération se termine.

Retours

Objet IAsyncResult indiquant l'état de l'opération asynchrone.

Exceptions

credential a la valeur null.

-ou-

targetName a la valeur null.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L’objet a été fermé.

L’authentification a déjà eu lieu.

- ou -

Ce flux a été utilisé précédemment pour tenter d'effectuer l'authentification en tant que serveur. Vous ne pouvez pas utiliser le flux pour faire une nouvelle tentative d'authentification en tant que client.

Remarques

Utilisez le requiredProtectionLevel paramètre pour demander des services de sécurité pour les données transmises à l’aide du flux authentifié. Par exemple, pour que les données soient chiffrées et signées, spécifiez la EncryptAndSign valeur. L’authentification réussie ne garantit pas que le demandé ProtectionLevel a été accordé. Vous devez case activée les IsEncrypted propriétés et IsSigned pour déterminer quels services de sécurité sont utilisés par .NegotiateStream

Cette méthode est asynchrone et ne bloque pas tant que l’opération se termine. Pour bloquer jusqu’à la fin de l’opération, utilisez l’une AuthenticateAsClient des surcharges de méthode.

L’opération d’authentification asynchrone doit être effectuée en appelant la EndAuthenticateAsClient méthode . En règle générale, la méthode est appelée par le asyncCallback délégué. Pour plus d’informations sur l’utilisation du modèle de programmation asynchrone, consultez Appel de méthodes synchrones de manière asynchrone

Si l’authentification échoue, vous recevez un AuthenticationException ou un InvalidCredentialException. Dans ce cas, vous pouvez réessayer l’authentification avec des informations d’identification différentes.

S’applique à

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

Appelé par les clients pour commencer une opération asynchrone d'authentification du client, et éventuellement du serveur, dans une connexion client-serveur. Le processus d'authentification utilise les informations d'identification, les options d'authentification et la liaison de canal spécifiées. Cette méthode ne provoque pas de blocage.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::Security::Authentication::ExtendedProtection::ChannelBinding ^ binding, System::String ^ targetName, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding? binding, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding binding, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, binding As ChannelBinding, targetName As String, requiredProtectionLevel As ProtectionLevel, allowedImpersonationLevel As TokenImpersonationLevel, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

Paramètres

credential
NetworkCredential

NetworkCredential utilisé pour établir l'identité du client.

binding
ChannelBinding

ChannelBinding qui est utilisé comme protection étendue.

targetName
String

Nom de principal du service (SPN) qui identifie de manière unique le serveur à authentifier.

requiredProtectionLevel
ProtectionLevel

L'une des valeurs ProtectionLevel, indiquant les services de sécurité pour le flux.

allowedImpersonationLevel
TokenImpersonationLevel

L'une des valeurs TokenImpersonationLevel, indiquant comment le serveur peut utiliser les informations d'identification du client pour accéder aux ressources.

asyncCallback
AsyncCallback

Délégué AsyncCallback qui fait référence à la méthode à appeler quand l’authentification est terminée.

asyncState
Object

Objet défini par l'utilisateur comportant des informations sur l'opération d'écriture. Cet objet est passé au délégué asyncCallback quand l'opération se termine.

Retours

Objet IAsyncResult indiquant l'état de l'opération asynchrone.

Exceptions

credential a la valeur null.

-ou-

targetName a la valeur null.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L'authentification a échoué. Vous pouvez utiliser cet objet pour faire une nouvelle tentative d'authentification.

L’authentification a déjà eu lieu.

- ou -

Ce flux a été utilisé précédemment pour tenter d'effectuer l'authentification en tant que serveur. Vous ne pouvez pas utiliser le flux pour faire une nouvelle tentative d'authentification en tant que client.

L’objet a été fermé.

Remarques

Utilisez le requiredProtectionLevel paramètre pour demander des services de sécurité pour les données transmises à l’aide du flux authentifié. Par exemple, pour que les données soient chiffrées et signées, spécifiez la EncryptAndSign valeur. L’authentification réussie ne garantit pas que le demandé ProtectionLevel a été accordé. Vous devez case activée les IsEncrypted propriétés et IsSigned pour déterminer quels services de sécurité sont utilisés par .NegotiateStream

Cette méthode est asynchrone et ne bloque pas tant que l’opération se termine. Pour bloquer jusqu’à la fin de l’opération, utilisez l’une AuthenticateAsClient des surcharges de méthode.

L’opération d’authentification asynchrone doit être effectuée en appelant la EndAuthenticateAsClient méthode . En règle générale, la méthode est appelée par le asyncCallback délégué. Pour plus d’informations sur l’utilisation du modèle de programmation asynchrone, consultez Appel de méthodes synchrones de manière asynchrone

Si l’authentification échoue, vous recevez un AuthenticationException ou un InvalidCredentialException. Dans ce cas, vous pouvez réessayer l’authentification avec des informations d’identification différentes.

Voir aussi

S’applique à