diff --git a/LoginOIDC/Controller.php b/LoginOIDC/Controller.php index df896839fcd227d37c473bc1b7890773ce5b6f9d..0866ee45b524d74a78617ab7f644a4f39f7bee14 100644 --- a/LoginOIDC/Controller.php +++ b/LoginOIDC/Controller.php @@ -231,7 +231,7 @@ class Controller extends \Piwik\Plugin\Controller throw new Exception(Piwik::translate("LoginOIDC_ExceptionUserNotFoundAndNoEmail")); } - $matomoUserLogin = $result->email; + $matomoUserLogin = $result->preferred_username; // Set an invalid pre-hashed password, to block the user from logging in by password Access::getInstance()->doAsSuperUser(function () use ($matomoUserLogin, $result) { UsersManagerApi::getInstance()->addUser($matomoUserLogin,