IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Метод

Определение

Возвращает экземпляр класса Authorization для запроса проверки подлинности, посылаемого на сервер.Returns an instance of the Authorization class for an authentication request to a 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);
abstract member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization

Параметры

request
WebRequest

Экземпляр класса WebRequest, связанный с запросом проверки подлинности.The WebRequest instance associated with the authentication request.

credentials
ICredentials

Учетные данные, связанные с запросом проверки подлинности.The credentials associated with the authentication request.

Возвраты

Экземпляр класса Authorization, содержащий сообщение авторизации для запроса.An Authorization instance containing the authorization message for the request.

Примеры

В следующем примере показано, как использовать метод PreAuthenticate.The following example shows how to use the PreAuthenticate method. Полный пример см AuthenticationManager . в классе.For a complete example refer to the AuthenticationManager class.

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

Комментарии

Если свойство имеет trueзначение, PreAuthenticate метод возвратит экземпляр класса, Authorization содержащего сообщение проверки подлинности. CanPreAuthenticateWhen the CanPreAuthenticate property is true, the PreAuthenticate method will return an instance of the Authorization class containing an authentication message.

Применяется к