Partager via


IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Méthode

Définition

Retourne une instance de la classe Authorization pour une demande d'authentification adressée à un serveur.

public:
 System::Net::Authorization ^ PreAuthenticate(System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
public System.Net.Authorization? PreAuthenticate (System.Net.WebRequest request, System.Net.ICredentials credentials);
public System.Net.Authorization PreAuthenticate (System.Net.WebRequest request, System.Net.ICredentials credentials);
abstract member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization

Paramètres

request
WebRequest

Instance de WebRequest associée à la demande d'authentification.

credentials
ICredentials

Informations d'identification associées à la demande d'authentification.

Retours

Instance de Authorization contenant le message d'autorisation lié à la demande.

Exemples

L'exemple suivant illustre l'utilisation de la méthode PreAuthenticate. Pour obtenir un exemple complet, reportez-vous à la AuthenticationManager classe .

// The PreAuthenticate method specifies if the authentication implemented
// by this class allows pre-authentication.
// Even if you do not use it, this method must be implemented to obey to the rules
// of interface implemebtation.
// In this case it always returns null.
virtual Authorization^ PreAuthenticate( WebRequest^ request, ICredentials^ credentials )
{
   return nullptr;
}
// The PreAuthenticate method specifies whether the authentication implemented
// by this class allows pre-authentication.
// Even if you do not use it, this method must be implemented to obey to the rules
// of interface implementation.
// In this case it always returns null.
public Authorization PreAuthenticate(WebRequest request, ICredentials credentials)
{
  return null;
}
' The PreAuthenticate method specifies whether the authentication implemented 
' by this class allows pre-authentication. 
' Even if you do not use it, this method must be implemented to obey to the rules 
' of interface implementation.
' In this case it always returns null. 
Public Function PreAuthenticate(ByVal request As WebRequest, ByVal credentials As ICredentials) As Authorization _
    Implements IAuthenticationModule.PreAuthenticate

  Return Nothing
End Function 'PreAuthenticate

Remarques

Lorsque la propriété a la CanPreAuthenticate valeur , la PreAuthenticate méthode retourne une instance de la Authorization classe contenant un message trued’authentification.

S’applique à