WindowsAuthenticationModule.Authenticate 이벤트

정의

애플리케이션이 현재 요청을 인증할 때 발생합니다.

public:
 event System::Web::Security::WindowsAuthenticationEventHandler ^ Authenticate;
public event System.Web.Security.WindowsAuthenticationEventHandler Authenticate;
member this.Authenticate : System.Web.Security.WindowsAuthenticationEventHandler 
Public Custom Event Authenticate As WindowsAuthenticationEventHandler 

이벤트 유형

예제

다음 코드 예제에서는 합니다 WindowsAuthentication_OnAuthenticate 이벤트가 설정 합니다 User 속성이 현재 HttpContext 사용자 지정 IPrincipal 개체입니다.

public void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs args)
{
  if (!args.Identity.IsAnonymous)
  {
    args.User = new Samples.AspNet.Security.MyPrincipal(args.Identity);
  }
}
Public Sub WindowsAuthentication_OnAuthenticate(sender As Object, args As WindowsAuthenticationEventArgs)
  If Not args.Identity.IsAnonymous Then
    args.User = New Samples.AspNet.Security.MyPrincipal(args.Identity)
  End If
End Sub

설명

합니다 Authenticate 이벤트가 발생 하는 동안는 AuthenticateRequest 이벤트입니다.

액세스할 수 있습니다 합니다 Authenticate 의 이벤트를 WindowsAuthenticationModule 라는 서브루틴을 지정 하 여 클래스 WindowsAuthentication_OnAuthenticate ASP.NET 애플리케이션의 Global.asax 파일에.

사용할 수는 User 의 속성을 WindowsAuthenticationEventArgs 개체가 제공를 WindowsAuthentication_OnAuthenticate 이벤트가 설정를 User 속성이 현재 HttpContext 사용자지정IPrincipal개체입니다. 에 대 한 값을 지정 하지 않는 경우는 User 중에 속성을 WindowsAuthentication_OnAuthenticate IIS에서 제공 하는 id가 현재 요청에 대 한 id로 사용 하는 Windows 이벤트. IIS는 익명 인증을 사용 하는 경우 해당 Identity 속성에서 반환 된 id로 설정 되는 GetAnonymous 메서드.

합니다 WindowsAuthentication_OnAuthenticate 이벤트는 경우에만 인증 Mode 로 설정 되어 WindowsWindowsAuthenticationModule 하는 애플리케이션에 대 한 활성 HTTP 모듈입니다.

참고

통합 모드에서 실행 하는 IIS 7.0에서는 Authenticate 이벤트를를 WindowsAuthenticationModule 발생할 때 모두 ASP.NET WindowsAuthenticationModule 및 IIS AnonymousAuthenticationModule 모듈을 사용 합니다. 이 시나리오에서는 인증 알림 수신, 구독에 AuthenticateRequest 의 이벤트는 HttpApplication 인스턴스. 통합된 모드의 호환성 문제에 대 한 자세한 내용은 참조 하세요. IIS 6.0에서 IIS 7.0 ASP.NET 애플리케이션 이동합니다.

적용 대상

추가 정보