WindowsAuthenticationModule 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Windows 인증을 사용하는 경우 ASP.NET 애플리케이션에 대한 사용자의 ID를 설정합니다. 이 클래스는 상속할 수 없습니다.
public ref class WindowsAuthenticationModule sealed : System::Web::IHttpModule
public sealed class WindowsAuthenticationModule : System.Web.IHttpModule
type WindowsAuthenticationModule = class
interface IHttpModule
Public NotInheritable Class WindowsAuthenticationModule
Implements IHttpModule
- 상속
-
WindowsAuthenticationModule
- 구현
예제
다음 코드 예제에서는 WindowsAuthentication_OnAuthenticate 이벤트를 사용 하 여 사용자 지정 IPrincipal 개체에 현재 HttpContext 속성을 설정 User 합니다.
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
설명
인증 Mode 이 설정 WindowsAuthenticationModuleWindows되면 현재 요청의 IIS에서 제공하는 Windows ID를 나타내는 개체로 현재 HttpContextIPrincipal 속성을 설정합니다User. IIS에서 익명 인증을 사용하는 경우 메서드 WindowsAuthenticationModule 에서 반환된 ID를 GetAnonymous 사용합니다.
현재 WindowsAuthenticationModule 속성HttpContext에 Authenticate 대한 User 사용자 지정 IPrincipal 개체를 제공할 수 있는 이벤트를 노출합니다. 이 Authenticate 이벤트는 ASP.NET 애플리케이션의 Global.asax 파일에 WindowsAuthentication_OnAuthenticate 이라는 서브루틴을 지정하여 액세스합니다.
메모
IIS 7.0에서는 클래스와 WindowsAuthenticationModule 함께 클래스를 FormsAuthenticationModule 사용할 수 없습니다. 통합 모드의 호환성 문제에 대한 자세한 내용은 IIS 6.0에서 IIS 7.0으로 ASP.NET 애플리케이션 이동을 참조하세요.
생성자
| Name | Description |
|---|---|
| WindowsAuthenticationModule() |
WindowsAuthenticationModule 클래스의 인스턴스를 만듭니다. |
메서드
| Name | Description |
|---|---|
| Dispose() |
에서 사용하는 메모리를 제외한 모든 리소스를 WindowsAuthenticationModule해제합니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| Init(HttpApplication) |
초기화는 WindowsAuthenticationModule 개체입니다. |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
이벤트
| Name | Description |
|---|---|
| Authenticate |
애플리케이션이 현재 요청을 인증할 때 발생합니다. |