ShibServiceFactory.php 576 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
<?php

namespace UnicaenAuth\Service;

use UnicaenAuth\Options\ModuleOptions;
use Zend\ServiceManager\ServiceLocatorInterface;

class ShibServiceFactory
{
    public function __invoke(ServiceLocatorInterface $sl)
    {
12
13
        /** @var ModuleOptions $moduleOptions */
        $moduleOptions = $sl->get('unicaen-auth_module_options');
14
15

        $service = new ShibService();
16
17
        $service->setShibbolethConfig($moduleOptions->getShibboleth());
        $service->setUsurpationAllowedUsernames($moduleOptions->getUsurpationAllowedUsernames());
18
19
20
21

        return $service;
    }
}