WindowsAuthenticationEventArgs 클래스

정의

WindowsAuthentication_OnAuthenticate 이벤트에 대한 데이터를 지원합니다. 이 클래스는 상속될 수 없습니다.

public ref class WindowsAuthenticationEventArgs sealed : EventArgs
public sealed class WindowsAuthenticationEventArgs : EventArgs
type WindowsAuthenticationEventArgs = class
    inherit EventArgs
Public NotInheritable Class WindowsAuthenticationEventArgs
Inherits EventArgs
상속
WindowsAuthenticationEventArgs

예제

다음 코드 예제에서는 합니다 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

설명

합니다 WindowsAuthenticationEventArgs 클래스 이벤트 값을 제공 하는 데 사용 됩니다 합니다 WindowsAuthentication_OnAuthenticate 이벤트 및 현재 요청에 대 한 사용자 지정 Windows id를 지정할 수 있도록 합니다.

WindowsAuthenticationModule 생성을 WindowsAuthenticationEventArgs IIS와 현재 제공 하는 Windows id를 사용 하 여 개체 HttpContext 에 전달 합니다 WindowsAuthentication_OnAuthenticate 이벤트.

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

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

생성자

WindowsAuthenticationEventArgs(WindowsIdentity, HttpContext)

WindowsAuthenticationEventArgs 클래스의 새로 만들어진 인스턴스를 초기화합니다.

속성

Context

현재 HTTP 요청에 대한 HttpContext 개체를 가져옵니다.

Identity

WindowsAuthenticationEventArgs 생성자에 전달된 Windows ID를 가져옵니다.

User

요청과 연결될 IPrincipal 개체를 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보