src/AuthModule/Controller/Plugin/Service/InteractiveAuthFactory.php
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceManager = $serviceLocator;
        if ($serviceManager instanceof AbstractPluginManager) {
            $serviceManager = $serviceManager->getServiceLocator();
        }
        /** @var $authService AuthenticationService */
        $authService = $serviceManager->get('AuthModule\AuthenticationService');
        /** @var $sessionManager SessionManager */
        $sessionManager = $serviceManager->get('Zend\Session\SessionManager');

        return new InteractiveAuth($authService, $sessionManager);
    }
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceManager = $serviceLocator;
        if ($serviceManager instanceof AbstractPluginManager) {
            $serviceManager = $serviceManager->getServiceLocator();
        }
        /** @var $authService AuthenticationService */
        $authService = $serviceManager->get('AuthModule\AuthenticationService');
        /** @var $sessionManager SessionManager */
        $sessionManager = $serviceManager->get('Zend\Session\SessionManager');

        return new InteractiveAuth($authService, $sessionManager);
    }
Create service

@param ServiceLocatorInterface $serviceLocator
@return AuthenticationService