IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Methode

Definition

Gibt eine Instanz der Authorization-Klasse für eine Authentifizierungsanforderung an einen Server zurück.

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

Parameter

request
WebRequest

Die der Authentifizierungsanforderung zugeordnete WebRequest-Instanz.

credentials
ICredentials

Die der Authentifizierungsanforderung zugeordneten Anmeldeinformationen.

Gibt zurück

Eine Authorization-Instanz mit der Autorisierungsmeldung für die Anforderung.

Beispiele

Im folgenden Beispiel wird die Verwendung der PreAuthenticate-Methode gezeigt. Ein vollständiges Beispiel finden Sie in der AuthenticationManager -Klasse.

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

Hinweise

Wenn die CanPreAuthenticate -Eigenschaft isttrue, gibt die PreAuthenticate -Methode einen instance der -Klasse zurück, die Authorization eine Authentifizierungsmeldung enthält.

Gilt für: