ClientWindowsAuthenticationMembershipProvider.Logout メソッド

定義

ユーザーをログアウトします。

public:
 void Logout();
public void Logout ();
member this.Logout : unit -> unit
Public Sub Logout ()

次のコード例は、このメソッドを使用してユーザーをログアウトする方法を示しています。

private void LogoutUsingWindowsAuthentication()
{
    ClientWindowsAuthenticationMembershipProvider authProvider =
        System.Web.Security.Membership.Provider as
        ClientWindowsAuthenticationMembershipProvider;

    authProvider.Logout();
}
Private Sub LogoutUsingWindowsAuthentication()

    Dim authProvider As ClientWindowsAuthenticationMembershipProvider = _
        CType(System.Web.Security.Membership.Provider,  _
        ClientWindowsAuthenticationMembershipProvider)

    authProvider.Logout()

End Sub

注釈

クライアント アプリケーション サービスを介して認証されたユーザーの場合、 staticThread.CurrentPrincipal プロパティは、構成されたロール サービスへのアクセスを可能にする オブジェクトに設定 ClientRolePrincipal されます。 メソッドはLogout、 プロパティをCurrentPrincipal現在WindowsIdentityWindowsPrincipal を含む オブジェクトにリセットします。 このメソッドを呼び出すと、 クラスを介して ClientRoleProvider ユーザーのロールを取得できなくなります。 現在のユーザーを再認証するには、 メソッドを ClientWindowsAuthenticationMembershipProvider.ValidateUser 呼び出します。

適用対象

こちらもご覧ください