src/Components/AlternateAuth.php
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.');
        }
    }
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.');
        }
    }
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.' ) ; } }
Handles login action including creating shadow user if needed

@param \DreamFactory\Core\Contracts\ServiceRequestInterface $request

@return array
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
@throws \DreamFactory\Core\Exceptions\RestException
@throws \DreamFactory\Core\Exceptions\UnauthorizedException
@throws \Exception
Handles login action including creating shadow user if needed