private function exchangeAuthUser($id)
    {
        $storage = $this->auth->getStorage();
        $originalUserId = $storage->read();
        $this->auth->clearIdentity();
        $storage->write($id);

        if ($acl = $this->getAclPlugin()) {
            $acl->setUser($this->auth->getUser());
        }

        return $originalUserId;
    }