public function handleLogin($request)
    {
        $filterString = $this->generateFilter($request);
        $remoteUser = $this->getRemoteUser($filterString);
        $password = $request->input($this->passwordField);
        $passwordHash = array_get($remoteUser, $this->passwordField);

        if ($this->verifyPassword($password, $passwordHash)) {
            $user = $this->createShadowUser($remoteUser);
            $forever = $request->input(static::REMEMBER_ME);
            $appId = Session::get('app.id');
            Session::setUserInfoWithJWT($user, $forever, $appId);

            return Session::getPublicInfo();
        } else {
            throw new UnauthorizedException('Invalid credential supplied.');
        }
    }