Exemplo n.º 1
0
        internal virtual LogoutUserResponse LogoutUser(LogoutUserRequest request)
        {
            var marshaller   = LogoutUserRequestMarshaller.Instance;
            var unmarshaller = LogoutUserResponseUnmarshaller.Instance;

            return(Invoke <LogoutUserRequest, LogoutUserResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the LogoutUser operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the LogoutUser operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/LogoutUser">REST API Reference for LogoutUser Operation</seealso>
        public virtual Task <LogoutUserResponse> LogoutUserAsync(LogoutUserRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = LogoutUserRequestMarshaller.Instance;
            var unmarshaller = LogoutUserResponseUnmarshaller.Instance;

            return(InvokeAsync <LogoutUserRequest, LogoutUserResponse>(request, marshaller,
                                                                       unmarshaller, cancellationToken));
        }
        public HttpResponseMessage Logout(LogoutUserRequest request)
        {
            LogoutUserResponse response = new LogoutUserResponse();

            //deleting session
            _sessionManager.DeleteSession(request.SessionId);
            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the LogoutUser operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the LogoutUser operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/LogoutUser">REST API Reference for LogoutUser Operation</seealso>
        public virtual Task <LogoutUserResponse> LogoutUserAsync(LogoutUserRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = LogoutUserRequestMarshaller.Instance;
            options.ResponseUnmarshaller = LogoutUserResponseUnmarshaller.Instance;

            return(InvokeAsync <LogoutUserResponse>(request, options, cancellationToken));
        }
Exemplo n.º 5
0
        internal virtual LogoutUserResponse LogoutUser(LogoutUserRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = LogoutUserRequestMarshaller.Instance;
            options.ResponseUnmarshaller = LogoutUserResponseUnmarshaller.Instance;

            return(Invoke <LogoutUserResponse>(request, options));
        }
 public SuccessResponse Logout(LogoutUserRequest request)
 {
     try
     {
         var user = _userRepository.FindBy(request.Id);
         user.ThrowExceptionIfRecordIsNull();
         return(new SuccessResponse {
             IsSuccess = true
         });
     }
     catch (DataAccessException)
     {
         throw new ApplicationException();
     }
 }
Exemplo n.º 7
0
        public LogoutUserResponse Handle(LogoutUserRequest request)
        {
            var response = new LogoutUserResponse();

            response.Errors = Validate(request);

            if (response.HasErrors)
            {
                return(response);
            }
            try
            {
                UserSessionRepository.DeleteUserSession(request.UserId);
            }
            catch (Exception ex)
            {
                response.Errors.Add(new ErrorStatus(ex.Message));
            }

            return(response);
        }
Exemplo n.º 8
0
        public HttpResponseMessage LogOut(string ticket)
        {
            var securityProvider = new SecurityProvider(_connectionString);

            var sessionInfo = securityProvider.GetSessionInfo(ticket);

            if (sessionInfo == null)
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized));
            }

            var logOutRequest = new LogoutUserRequest
            {
                UserId = sessionInfo.User.Id
            };

            var handler = new LogoutUserHandler(_connectionString);

            var response = handler.Handle(logOutRequest);

            var httpStatusCode = ResolveStatusCode(response);

            return(Request.CreateResponse(httpStatusCode));
        }
Exemplo n.º 9
0
 public SuccessResponse Logout(LogoutUserRequest request)
 {
     return(_userService.Logout(request));
 }
Exemplo n.º 10
0
        private IList <ErrorStatus> Validate(LogoutUserRequest request)
        {
            var errors = new List <ErrorStatus>();

            return(errors);
        }