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 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 - Ajout d'un événement avec le détail des erreurs LDAP
3.2.5 3.2.5
......
...@@ -4,6 +4,7 @@ namespace UnicaenAuth\Authentication\Storage; ...@@ -4,6 +4,7 @@ namespace UnicaenAuth\Authentication\Storage;
use Interop\Container\ContainerInterface; use Interop\Container\ContainerInterface;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class AuthFactory class AuthFactory
{ {
...@@ -14,8 +15,11 @@ class AuthFactory ...@@ -14,8 +15,11 @@ class AuthFactory
*/ */
public function __invoke(ContainerInterface $container, string $requestedName): Auth public function __invoke(ContainerInterface $container, string $requestedName): Auth
{ {
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Auth(); $storage = new Auth();
$storage->setStorage(new Session(Usurpation::class)); $storage->setStorage(new Session(Usurpation::class, null, $sessionManager));
return $storage; return $storage;
} }
......
...@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface; ...@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenAuth\Authentication\Adapter\Db as DbAdapter; use UnicaenAuth\Authentication\Adapter\Db as DbAdapter;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
use ZfcUser\Mapper\UserInterface as UserMapper; use ZfcUser\Mapper\UserInterface as UserMapper;
class DbFactory class DbFactory
...@@ -24,8 +25,11 @@ class DbFactory ...@@ -24,8 +25,11 @@ class DbFactory
/** @var ModuleOptions $moduleOptions */ /** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options'); $moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Db(); $storage = new Db();
$storage->setStorage(new Session(DbAdapter::class)); $storage->setStorage(new Session(DbAdapter::class, null, $sessionManager));
$storage->setMapper($mapper); $storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions); $storage->setModuleOptions($moduleOptions);
......
...@@ -7,6 +7,7 @@ use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; ...@@ -7,6 +7,7 @@ use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenAuth\Authentication\Adapter\Ldap as LdapAdapter; use UnicaenAuth\Authentication\Adapter\Ldap as LdapAdapter;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class LdapFactory class LdapFactory
{ {
...@@ -18,8 +19,11 @@ class LdapFactory ...@@ -18,8 +19,11 @@ class LdapFactory
/** @var ModuleOptions $moduleOptions */ /** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options'); $moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Ldap(); $storage = new Ldap();
$storage->setStorage(new Session(LdapAdapter::class)); $storage->setStorage(new Session(LdapAdapter::class, null, $sessionManager));
$storage->setMapper($mapper); $storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions); $storage->setModuleOptions($moduleOptions);
......
...@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface; ...@@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use UnicaenAuth\Service\ShibService; use UnicaenAuth\Service\ShibService;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
class ShibFactory class ShibFactory
{ {
...@@ -23,8 +24,11 @@ class ShibFactory ...@@ -23,8 +24,11 @@ class ShibFactory
/** @var ModuleOptions $moduleOptions */ /** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options'); $moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Shib(); $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->setShibService($shibService);
$storage->setModuleOptions($moduleOptions); $storage->setModuleOptions($moduleOptions);
......
...@@ -5,6 +5,7 @@ namespace UnicaenAuth\Authentication\Storage; ...@@ -5,6 +5,7 @@ namespace UnicaenAuth\Authentication\Storage;
use Interop\Container\ContainerInterface; use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Session\SessionManager;
use ZfcUser\Mapper\UserInterface as UserMapper; use ZfcUser\Mapper\UserInterface as UserMapper;
class UsurpationFactory class UsurpationFactory
...@@ -23,8 +24,11 @@ class UsurpationFactory ...@@ -23,8 +24,11 @@ class UsurpationFactory
/** @var ModuleOptions $moduleOptions */ /** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options'); $moduleOptions = $container->get('unicaen-auth_module_options');
/** @var SessionManager $sessionManager */
$sessionManager = $container->get(SessionManager::class);
$storage = new Usurpation(); $storage = new Usurpation();
$storage->setStorage(new Session(Usurpation::class)); $storage->setStorage(new Session(Usurpation::class, null, $sessionManager));
$storage->setMapper($mapper); $storage->setMapper($mapper);
$storage->setModuleOptions($moduleOptions); $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