다음을 통해 공유


SessionAuthenticationModule.SignOut 메서드

정의

현재 사용자를 로그아웃하고 관련 이벤트를 발생시킵니다.

public:
 virtual void SignOut();
public virtual void SignOut ();
abstract member SignOut : unit -> unit
override this.SignOut : unit -> unit
Public Overridable Sub SignOut ()

예제

다음 코드에서는 호출에 대 한 코드는 SignOut SignOut.aspx 페이지 (SignOut.aspx.cs) ASP.NET 웹 애플리케이션에서 메서드. 보다 완전 한 예제에 표시 됩니다는 SessionAuthenticationModule 개요 항목입니다.

void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup

    //SUBSCRIBE TO SAM EVENTS
    FederatedAuthentication.SessionAuthenticationModule.SessionSecurityTokenCreated += new EventHandler<SessionSecurityTokenCreatedEventArgs>(SessionAuthenticationModule_SessionSecurityTokenCreated);
    FederatedAuthentication.SessionAuthenticationModule.SessionSecurityTokenReceived += new EventHandler<SessionSecurityTokenReceivedEventArgs>(SessionAuthenticationModule_SessionSecurityTokenReceived);
    FederatedAuthentication.SessionAuthenticationModule.SigningOut += new EventHandler<SigningOutEventArgs>(SessionAuthenticationModule_SigningOut);
    FederatedAuthentication.SessionAuthenticationModule.SignedOut += new EventHandler(SessionAuthenticationModule_SignedOut);
    FederatedAuthentication.SessionAuthenticationModule.SignOutError += new EventHandler<ErrorEventArgs>(SessionAuthenticationModule_SignOutError);
}

설명

호출 하는 OnSigningOut, DeleteSessionTokenCookie, 및 OnSignedOut 로그 아웃을 수행 하는 방법입니다. 예외가 발생 하는 경우는 OnSignOutError 시키려면 메서드가 호출 되는 SignOutError 이벤트입니다. 설정할 수 있습니다 합니다 Cancel 의 속성을 ErrorEventArgs 개체가이 이벤트는 로그 아웃을 취소 하 고를 클라이언트에 전파 되는 예외를 방지에 대 한 이벤트 처리기에 전달 합니다.

애플리케이션별 동작을 추가 하려면이 메서드를 재정의할 수 있습니다.

적용 대상