public function createSessionFromRequest($request, $resolver)
    {
        if (!$this->isRestController($resolver)) {
            return false;
        }
        /** @var SessionBuilder $builder */
        foreach ($this->getSessionBuilders() as $builder) {
            if ($builder->isApplicable($request)) {
                return $this->startSession($builder->getSession($request));
            }
        }
        throw new LoginFailedException(array('Request cannot be authenticated.'));
    }