Esempio n. 1
0
 public FubuContinuation Get(LogoffRequest request)
 {
     _authenticationContext.SignOut();
     return(FubuContinuation.RedirectTo(new LoginRequest()
     {
         ReturnUrl = "/"
     }));
 }
Esempio n. 2
0
        public static LogoffResponse LogUserOff(LogoffRequest request)
        {
            // Unregister user from the container:
            if (AsyncListener.ConnectedClientIds.Contains(request.UserId)
                == true)
            {
                AsyncListener.ConnectedClientIds.Remove(request.UserId);
            }

            // Add server ID:
            LogoffResponse logoffResponse = new LogoffResponse();

            logoffResponse.UserId = "0";

            return(logoffResponse);
        }
Esempio n. 3
0
        /// <summary>
        /// Close socket and exit program.
        /// </summary>
        public void Logoff()
        {
            LogoffRequest logoff = new LogoffRequest()
            {
                UserId = MessengerService.ClientId
            };

            this.SendRequest(logoff.SerializeToJson(), this.ClientSocket);

            string jsonLogoffResponse = this.ReceiveResponse(this.ClientSocket);

            MessengerService.ClientId = null;

            ClientSocket.Shutdown(SocketShutdown.Both);
            ClientSocket.Close();

            Environment.Exit(0);
        }
Esempio n. 4
0
        public NTStatus Logoff()
        {
            if (!m_isConnected)
            {
                throw new InvalidOperationException("A login session must be successfully established before attempting logoff");
            }

            LogoffRequest request   = new LogoffRequest();
            ulong         messageId = TrySendCommand(request);

            SMB2Command response = WaitForCommand(SMB2CommandName.Logoff, messageId);

            if (response != null)
            {
                m_isLoggedIn = (response.Header.Status != NTStatus.STATUS_SUCCESS);
                return(response.Header.Status);
            }
            return(NTStatus.STATUS_INVALID_SMB);
        }
Esempio n. 5
0
        public async Task <NTStatus> LogoffAsync(CancellationToken cancellationToken)
        {
            if (!m_isConnected)
            {
                throw new InvalidOperationException("A login session must be successfully established before attempting logoff");
            }

            LogoffRequest request = new LogoffRequest();

            await TrySendCommandAsync(request, cancellationToken);

            SMB2Command response = WaitForCommand(SMB2CommandName.Logoff);

            if (response != null)
            {
                m_isLoggedIn = (response.Header.Status != NTStatus.STATUS_SUCCESS);
                return(response.Header.Status);
            }
            return(NTStatus.STATUS_INVALID_SMB);
        }
Esempio n. 6
0
 public System.Threading.Tasks.Task <LogoffResponse> LogoffAsync(LogoffRequest request)
 {
     return(base.Channel.LogoffAsync(request));
 }
Esempio n. 7
0
 public FubuContinuation Get(LogoffRequest request)
 {
     _authenticationContext.SignOut();
     return FubuContinuation.RedirectTo(new LoginRequest() {ReturnUrl = "/"});
 }