WindowsAuthenticationEventHandler 대리자
이 문서의 내용
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
WindowsAuthenticationModule의 WindowsAuthentication_OnAuthenticate 이벤트를 처리하는 메서드를 나타냅니다.
public delegate void WindowsAuthenticationEventHandler(System::Object ^ sender, WindowsAuthenticationEventArgs ^ e);
public delegate void WindowsAuthenticationEventHandler(object sender, WindowsAuthenticationEventArgs e);
type WindowsAuthenticationEventHandler = delegate of obj * WindowsAuthenticationEventArgs -> unit
Public Delegate Sub WindowsAuthenticationEventHandler(sender As Object, e As WindowsAuthenticationEventArgs)
- sender
- Object
이벤트 소스입니다.
이벤트 데이터를 포함하는 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
WindowsAuthenticationEventHandler 대리자에 대해 정의 된 합니다 Authenticate 이벤트는 WindowsAuthenticationModule 클래스. 액세스할 수 있습니다 합니다 Authenticate 의 이벤트를 WindowsAuthenticationModule 라는 서브루틴을 지정 하 여 클래스 WindowsAuthentication_OnAuthenticate ASP.NET 애플리케이션의 Global.asax 파일에. 합니다 Authenticate 이벤트가 발생 하는 동안는 AuthenticateRequest 이벤트입니다.
WindowsAuthenticationModule 생성을 WindowsAuthenticationEventArgs IIS와 현재 제공 하는 Windows id를 사용 하 여 개체 HttpContext 에 전달 합니다 WindowsAuthentication_OnAuthenticate 이벤트.
사용할 수는 User 의 속성을 WindowsAuthenticationEventArgs 개체가 제공를 WindowsAuthentication_OnAuthenticate 이벤트가 설정를 User 속성이 현재 HttpContext 사용자지정IPrincipal개체입니다. 에 대 한 값을 지정 하지 않는 경우는 User 중에 속성을 WindowsAuthentication_OnAuthenticate IIS에서 제공 하는 id가 현재 요청에 대 한 id로 사용 하는 Windows 이벤트. IIS 익명 인증을 사용 하는 경우 해당 Identity 의 속성을 WindowsAuthenticationEventArgs 개체에서 반환 된 id로 설정 됩니다는 GetAnonymous 메서드.
합니다 WindowsAuthentication_OnAuthenticate 이벤트는만 있을 때 발생 인증 Mode 로 설정 되어 Windows 및 WindowsAuthenticationModule 하는 애플리케이션에 대 한 활성 HTTP 모듈입니다.
Get |
지정된 대리자가 나타내는 메서드를 나타내는 개체를 가져옵니다. |
제품 | 버전 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.