다음을 통해 공유


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 인스턴스를 반환합니다.

적용 대상