You signed in with another tab or window. Reload to refresh your session.You signed out in another tab o
8000
r window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 11, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 11, 2026. It is now read-only.
"OAuth state mismatch" error when the user already logged in #97
Hello, thank you for developing the plugin. It's excellent and we're happy using it.
However, we've encountered one issue: when the user already has the matomo session, the plugin throws the error.
Steps to reproduce:
Login via /index.php?module=LoginOIDC&action=signin path (we enabled the direct login URL)
After logging in, visit the path above again /index.php?module=LoginOIDC&action=signin
Notice that the plugin will go through the OAuth flow again
In the callback function /index.php?module=LoginOIDC&action=callback&provider=oidc&code=....
If the authenticated user of the OAuth flow above is the same as the logged-in user in Matomo's session, the user will see the "OAuth state mismatch" error screen
My finding:
In the callback function of the Controller, in the end, there is the logic:
if (Piwik::getCurrentUserLogin() === $user["login"]) {
$this->passwordVerify->setPasswordVerifiedCorrectly();
return;
}
And the $this->passwordVerify->setPasswordVerifiedCorrectly code is:
if ($this->enableRedirect) {
Url::redirectToUrl('index.php' . Url::getCurrentQueryStringWithParametersModified(
$sessionNamespace->redirectParams
));
}
So the callback action will redirect to itself and throw the error.
One solution (in my opinion) is to check for the login session in the signin action and redirect the user to /index.php.
What do you think?
Activity
rileyjnevins commentedon Oct 15, 2023
I am encountering the same issue.
sschueller commentedon Feb 26, 2024
I can confirm, I see the same issue on my setup.