Compartir vía


IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Método

Definición

Devuelve una instancia de la clase Authorization para una solicitud de autenticación a un servidor.

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

Parámetros

request
WebRequest

Instancia de WebRequest asociada a la solicitud de autenticación.

credentials
ICredentials

Credenciales asociadas a la solicitud de autenticación.

Devoluciones

Instancia de Authorization que contiene el mensaje de autorización de la solicitud.

Ejemplos

En el siguiente ejemplo, se muestra cómo utilizar el método PreAuthenticate. Para obtener un ejemplo completo, consulte la AuthenticationManager clase .

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

Comentarios

Cuando la CanPreAuthenticate propiedad es true, el PreAuthenticate método devolverá una instancia de la Authorization clase que contiene un mensaje de autenticación.

Se aplica a