Share via


FormsAuthentication 클래스

IAuthentication 인터페이스를 구현하는 도메인 서비스에서 생성된 DomainContext를 사용하여 Forms 인증을 수행하는 인증 서비스 구현을 제공합니다.

네임스페이스: System.ServiceModel.DomainServices.Client.ApplicationServices
어셈블리: system.servicemodel.domainservices.client.web.dll의 System.ServiceModel.DomainServices.Client.Web

사용법

‘사용 방법
Dim instance As FormsAuthentication

구문

‘선언
Public Class FormsAuthentication
    Inherits WebAuthenticationService
public class FormsAuthentication : WebAuthenticationService
public ref class FormsAuthentication : public WebAuthenticationService
public class FormsAuthentication extends WebAuthenticationService
public class FormsAuthentication extends WebAuthenticationService

설명

Forms 인증을 사용하도록 응용 프로그램을 구성하려면 서버 및 클라이언트 프로젝트에서 모두 값을 설정해야 합니다. 클라이언트 프로젝트에서 값을 설정하는 경우 FormsAuthentication 클래스를 사용합니다.

서버 프로젝트의 Web.config 파일에서 다음 예제와 같이 인증 모드“Forms”로 설정합니다.

<system.web>
  <authentication mode="Forms"></authentication>
</system.web>

클라이언트 응용 프로그램에 대한 Application 개체의 생성자에서 다음 예제와 같이 WebContext 개체의 Authentication 속성을 FormsAuthentication으로 설정합니다. 일반적으로 생성자는 App.xaml.cs 또는 App.xaml.vb 파일에 있습니다.

Public Sub New()
    InitializeComponent()

    Dim webcontext As New WebContext
    webcontext.Authentication = New System.ServiceModel.DomainServices.Client.ApplicationServices.FormsAuthentication
    Me.ApplicationLifetimeObjects.Add(webcontext)
End Sub
public App()
{
    this.Startup += this.Application_Startup;
    this.UnhandledException += this.Application_UnhandledException;

    InitializeComponent();

    WebContext webcontext = new WebContext();
    webcontext.Authentication = new System.ServiceModel.DomainServices.Client.ApplicationServices.FormsAuthentication();
    this.ApplicationLifetimeObjects.Add(webcontext);
}

상속 계층

System.Object
   System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationService
     System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService
      System.ServiceModel.DomainServices.Client.ApplicationServices.FormsAuthentication

스레드 보안

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 모든 인스턴스 멤버는 스레드로부터 안전하지 않을 수 있습니다.

플랫폼

개발 플랫폼

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 , Windows Server 2008 및 Windows 2000

대상 플랫폼

Change History

참고 항목

참조

FormsAuthentication 멤버
System.ServiceModel.DomainServices.Client.ApplicationServices 네임스페이스