eZ\Publish\Core\REST\Server\Authenticator\BasicAuth::authenticate PHP Method

authenticate() public method

Performs an authentication based on the given $request and sets the authenticated user into the $repository. Returns true on success, false of authentication was not possible or did not succeed.
public authenticate ( Qafoo\RMF\Request $request ) : boolean
$request Qafoo\RMF\Request
return boolean
    public function authenticate(RMF\Request $request)
    {
        try {
            $this->repository->setCurrentUser($this->repository->getUserService()->loadUserByCredentials($request->username, $request->password));
        } catch (InvalidArgumentException $e) {
            return false;
        } catch (NotFoundException $e) {
            throw new AuthenticationFailedException();
        }
    }