다음을 통해 공유


SessionAuthenticationModule.SignOut 메서드

정의

현재 사용자를 로그아웃하고 연결된 이벤트를 발생합니다.

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

예제

다음 코드는 ASP.NET 웹 애플리케이션의 SignOut SignOut.aspx 페이지(SignOut.aspx.cs)에서 메서드를 호출하는 코드를 보여 줍니다. 개요 항목에 보다 완전한 예제가 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);
}

설명

및 메서드를 OnSigningOutDeleteSessionTokenCookieOnSignedOut 호출하여 로그아웃을 수행합니다. 예외가 OnSignOutError 발생하면 이벤트를 발생하도록 메서드가 SignOutError 호출됩니다. 이 이벤트에 대한 이벤트 처리기에 전달된 개체의 ErrorEventArgs 속성을 설정 Cancel 하여 로그아웃을 취소하고 예외가 클라이언트로 전파되지 않도록 할 수 있습니다.

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

적용 대상