diff --git a/config/module.config.php b/config/module.config.php
index b0b657e3907434f6cebed79bfc97db4978ac5944..b015ae6ff8c3e1e9babb0b2f034142249d61281e 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -3,6 +3,7 @@
 use UnicaenAuth\Controller\AuthControllerFactory;
 use UnicaenAuth\Service\ShibService;
 use UnicaenAuth\Service\ShibServiceFactory;
+use UnicaenAuth\Service\UserContextFactory;
 use UnicaenAuth\View\Helper\ShibConnectViewHelperFactory;
 
 $settings = [
@@ -373,7 +374,6 @@ return [
             'UnicaenAuth\Authentication\Storage\Ldap' => 'UnicaenAuth\Authentication\Storage\Ldap',
             'UnicaenAuth\Authentication\Storage\Shib' => 'UnicaenAuth\Authentication\Storage\Shib',
             'UnicaenAuth\View\RedirectionStrategy'    => 'UnicaenAuth\View\RedirectionStrategy',
-            'UnicaenAuth\Service\UserContext'         => 'UnicaenAuth\Service\UserContext',
             'UnicaenAuth\Service\User'                => 'UnicaenAuth\Service\User',
             'UnicaenAuth\Service\CategoriePrivilege'  => 'UnicaenAuth\Service\CategoriePrivilegeService',
         ],
@@ -396,6 +396,7 @@ return [
             'BjyAuthorize\Service\Authorize'           => 'UnicaenAuth\Service\AuthorizeServiceFactory', // substituion
             'zfcuser_redirect_callback'                => 'UnicaenAuth\Authentication\RedirectCallbackFactory', // substituion
             ShibService::class                         => ShibServiceFactory::class,
+            'UnicaenAuth\Service\UserContext'          => UserContextFactory::class,
             'MouchardCompleterAuth'        => 'UnicaenAuth\Mouchard\MouchardCompleterAuthFactory',
         ],
         'shared' => [
diff --git a/src/UnicaenAuth/Service/UserContextFactory.php b/src/UnicaenAuth/Service/UserContextFactory.php
new file mode 100644
index 0000000000000000000000000000000000000000..cec79970d09c353e3ebfd9a97f67849f9d3b9d1c
--- /dev/null
+++ b/src/UnicaenAuth/Service/UserContextFactory.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace UnicaenAuth\Service;
+
+use Zend\ServiceManager\ServiceLocatorInterface;
+
+class UserContextFactory
+{
+    /**
+     * @param ServiceLocatorInterface $sl
+     * @return UserContext
+     */
+    public function __invoke(ServiceLocatorInterface $sl)
+    {
+        $service = new UserContextService();
+
+        return $service;
+    }
+}
\ No newline at end of file