Commit 2ca70d49 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Données d'authentification : utilisation du SessionManager global pour...

[FIX] Données d'authentification : utilisation du SessionManager global pour avoir les durées de conservation des cookies correctes.
parent 0f958505
Pipeline #11030 passed with stage
in 17 seconds
CHANGELOG
=========
3.2.6 / 3.2.7
3.2.8
-----
- [FIX] Données d'authentification : utilisation du SessionManager global pour avoir les durées de conservation des cookies correctes.
3.2.6 / 3.2.7
-----
- Ajout d'un événement avec le détail des erreurs LDAP
3.2.5
......
......@@ -4,6 +4,7 @@ namespace UnicaenAuth\Authentication\Storage;
use Interop\Container\ContainerInterface;
use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class AuthFactory
{
......@@ -14,8 +15,11 @@ class AuthFactory
*/
public function __invoke(ContainerInterface $container, string $requestedName): Auth
{
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Auth();
$storage->setStorage(new Session(Usurpation::class));
$storage->setStorage(new Session(Usurpation::class, null, $sessionManager));
return $storage;
}
......
......@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenAuth\Authentication\Adapter\Db as DbAdapter;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
use ZfcUser\Mapper\UserInterface as UserMapper;
class DbFactory
......@@ -24,8 +25,11 @@ class DbFactory
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Db();
$storage->setStorage(new Session(DbAdapter::class));
$storage->setStorage(new Session(DbAdapter::class, null, $sessionManager));
$storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions);
......
......@@ -7,6 +7,7 @@ use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenAuth\Authentication\Adapter\Ldap as LdapAdapter;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class LdapFactory
{
......@@ -18,8 +19,11 @@ class LdapFactory
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Ldap();
$storage->setStorage(new Session(LdapAdapter::class));
$storage->setStorage(new Session(LdapAdapter::class, null, $sessionManager));
$storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions);
......
......@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions;
use UnicaenAuth\Service\ShibService;
use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class ShibFactory
{
......@@ -23,8 +24,11 @@ class ShibFactory
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Shib();
$storage->setStorage(new Session(\UnicaenAuth\Authentication\Adapter\Shib::class));
$storage->setStorage(new Session(\UnicaenAuth\Authentication\Adapter\Shib::class, null, $sessionManager));
$storage->setShibService($shibService);
$storage->setModuleOptions($moduleOptions);
......
......@@ -5,6 +5,7 @@ namespace UnicaenAuth\Authentication\Storage;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
use ZfcUser\Mapper\UserInterface as UserMapper;
class UsurpationFactory
......@@ -23,8 +24,11 @@ class UsurpationFactory
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Usurpation();
$storage->setStorage(new Session(Usurpation::class));
$storage->setStorage(new Session(Usurpation::class, null, $sessionManager));
$storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment