def login(user, password)
      data = request('authenticateUser',
                     { username: user, password: password },
                     true)
      @user = User.new(self, data)
      fail InvalidAuthentication, 'Wrong username or password!' if @user.id == 0

      @user
    end
def login(user, password)
      data = request('authenticateUser',
                     { username: user, password: password },
                     true)
      @user = User.new(self, data)
      fail InvalidAuthentication, 'Wrong username or password!' if @user.id == 0

      @user
    end
Authenticate user