IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) メソッド

定義

サーバーへの認証要求のために Authorization クラスのインスタンスを返します。

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

パラメーター

request
WebRequest

認証要求と関連付けられる WebRequest インスタンス。

credentials
ICredentials

認証要求と関連付けられる資格情報。

戻り値

要求の承認メッセージを格納する Authorization インスタンス。

PreAuthenticate メソッドを使用する方法の例を次に示します。 完全な例については、 AuthenticationManager クラスを参照してください。

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

注釈

プロパティが CanPreAuthenticatetrue場合、 PreAuthenticate メソッドは認証メッセージを Authorization 含む クラスのインスタンスを返します。

適用対象