private void ReadUserDataCompleted(ClientMessage.ReadStreamEventsBackwardCompleted completed,
                                           AuthenticationRequest authenticationRequest)
        {
            try {
                if (completed.Result == ReadStreamResult.StreamDeleted ||
                    completed.Result == ReadStreamResult.NoStream ||
                    completed.Result == ReadStreamResult.AccessDenied)
                {
                    authenticationRequest.Unauthorized();
                    return;
                }

                if (completed.Result == ReadStreamResult.Error)
                {
                    authenticationRequest.NotReady();
                    return;
                }

                var userData = completed.Events[0].Event.Data.ParseJson <UserData>();
                if (userData.LoginName != authenticationRequest.Name)
                {
                    authenticationRequest.Error();
                    return;
                }

                if (userData.Disabled)
                {
                    authenticationRequest.Unauthorized();
                }
                else
                {
                    AuthenticateWithPasswordHash(authenticationRequest, userData);
                }
            } catch {
                authenticationRequest.Unauthorized();
            }
        }
 public void Authenticate(AuthenticationRequest authenticationRequest)
 {
 }