Condividi tramite


IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Metodo

Definizione

Restituisce un'istanza della Authorization classe per una richiesta di autenticazione a un server.

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

Parametri

request
WebRequest

WebRequest Istanza associata alla richiesta di autenticazione.

credentials
ICredentials

Credenziali associate alla richiesta di autenticazione.

Restituisce

Authorization Istanza contenente il messaggio di autorizzazione per la richiesta.

Esempio

Nell'esempio seguente viene illustrato come usare il PreAuthenticate metodo . Per un esempio completo, vedere la AuthenticationManager classe .

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

Commenti

Quando la CanPreAuthenticate proprietà è true, il PreAuthenticate metodo restituirà un'istanza della Authorization classe contenente un messaggio di autenticazione.

Si applica a