You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to update from matomo 3.0.2 to 3.9.1
We have a custom plugin in place for authentication. Matomo is running on windows server 2012 (php 5.6) and we use windows authentication with NTLM on IIS to provide a SSO method for our matomo users.
With the old version, everything works fine.
The custom plugin is pretty simple and does something like that:
namespace Piwik\Plugins\LoginWindowsSSO;
use Piwik\Plugins\UsersManager\Model;
use Piwik\Plugins\Login\Auth;
use Piwik\Plugins\Logging\Logger;
use Piwik\Plugins\Login\Controller;
use Piwik\Piwik;
class LoginWindowsSSO extends \Piwik\Plugin {
private $log;
public function __construct($pluginName = false) {
$this->log = new Logger($this, "sso");
parent::__construct($pluginName);
}
function getListHooksRegistered() {
return array(
'Request.initAuthenticationObject' => 'initAuthenticationObject'
);
}
function initAuthenticationObject($activateCookieAuth = false) {
$this->log->debug("=> #initAuthenticationObject");
$login = $this->getWinUser(); // this method extract the login name from request headers
if (!empty($login)) {
$auth = new Auth();
$model = new Model();
$user = $model->getUser($login);
if (!empty($user)) {
$this->log->info("===> logon success for user $login");
$auth->setLogin($login);
$auth->setTokenAuth($user['token_auth']);
} else {
$this->log->warn("===> User $login was not found in the Piwik database; logon won't work.");
}
\Piwik\Registry::set('auth', $auth);
} else {
$this->log->warn("==> logon user could not be retrieved from request; logon won't work.");
}
}
}
After the update to 3.9.1 it is not working anymore.
I checked the official docs and I noticed that we are missing the $auth->authenticate() method, but adding this doesn't work either.
I also debugged the authenticate method when in place, and it seems like it is executed twice, once with the correct auth object and after that once more with 'anonymous'. I don't know why, though (in the old version, it's only called once, without calling authenticate explicitly).
In the docs it also says Registry::set('auth', $auth) should be replaced with StaticContainer::getContainer()->set('Piwik\Auth', $auth), but this doesn't work, as well.
At this point I'm out of ideas.
Thanks for your help.
The text was updated successfully, but these errors were encountered:
That's just a guess though. Not sure from which version you updated but this shouldn't have worked in quite a while in the recent versions if I had to guess without investigating too much. From which version did you update?
Hi,
I'm trying to update from matomo 3.0.2 to 3.9.1
We have a custom plugin in place for authentication. Matomo is running on windows server 2012 (php 5.6) and we use windows authentication with NTLM on IIS to provide a SSO method for our matomo users.
With the old version, everything works fine.
The custom plugin is pretty simple and does something like that:
After the update to 3.9.1 it is not working anymore.
I checked the official docs and I noticed that we are missing the
$auth->authenticate()
method, but adding this doesn't work either.I also debugged the authenticate method when in place, and it seems like it is executed twice, once with the correct auth object and after that once more with 'anonymous'. I don't know why, though (in the old version, it's only called once, without calling
authenticate
explicitly).In the docs it also says
Registry::set('auth', $auth)
should be replaced withStaticContainer::getContainer()->set('Piwik\Auth', $auth)
, but this doesn't work, as well.At this point I'm out of ideas.
Thanks for your help.
The text was updated successfully, but these errors were encountered: