diff --git a/CHANGELOG.md b/CHANGELOG.md index e0f78ce9442195ef31a83adb4a0570a44d67e893..b5fc83d94450c95194ca1e82e49790f2474d372d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ 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 diff --git a/src/UnicaenAuth/Authentication/Storage/AuthFactory.php b/src/UnicaenAuth/Authentication/Storage/AuthFactory.php index c652d3be61b2cb41bd7be9fa4ed233168b880619..7dc7f0e9c55a9a249e609b05d2a4cdf355260d9f 100644 --- a/src/UnicaenAuth/Authentication/Storage/AuthFactory.php +++ b/src/UnicaenAuth/Authentication/Storage/AuthFactory.php @@ -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; } diff --git a/src/UnicaenAuth/Authentication/Storage/DbFactory.php b/src/UnicaenAuth/Authentication/Storage/DbFactory.php index 59f8f1abceaea8e9510f6eac8fb2e89a8ffed81c..d027285c690f0756e5899a322e387f4c316ca03c 100644 --- a/src/UnicaenAuth/Authentication/Storage/DbFactory.php +++ b/src/UnicaenAuth/Authentication/Storage/DbFactory.php @@ -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); diff --git a/src/UnicaenAuth/Authentication/Storage/LdapFactory.php b/src/UnicaenAuth/Authentication/Storage/LdapFactory.php index 0530e124a5e7e4014f0d402feceebfe0945de78a..a891ba98af296d0ad026c6183c1aac1d88f0b2fd 100644 --- a/src/UnicaenAuth/Authentication/Storage/LdapFactory.php +++ b/src/UnicaenAuth/Authentication/Storage/LdapFactory.php @@ -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); diff --git a/src/UnicaenAuth/Authentication/Storage/ShibFactory.php b/src/UnicaenAuth/Authentication/Storage/ShibFactory.php index 07f3c969e3013dde557039195a43d188a13227aa..7a9a7b461574322bcf3678bbcb3d86b4ceda2fba 100644 --- a/src/UnicaenAuth/Authentication/Storage/ShibFactory.php +++ b/src/UnicaenAuth/Authentication/Storage/ShibFactory.php @@ -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); diff --git a/src/UnicaenAuth/Authentication/Storage/UsurpationFactory.php b/src/UnicaenAuth/Authentication/Storage/UsurpationFactory.php index 80be0aeef1021352230687721ff49a39c68c2fdb..b1faf80f503cc2548c417eafd375f6daacf03a1a 100644 --- a/src/UnicaenAuth/Authentication/Storage/UsurpationFactory.php +++ b/src/UnicaenAuth/Authentication/Storage/UsurpationFactory.php @@ -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);