dominik-th / matomo-plugin-LoginOIDC

external authentication services for matomo
https://plugins.matomo.org/LoginOIDC/
GNU General Public License v3.0
41 stars 29 forks source link

Google OAuth2 #9

Closed manuelw99 closed 4 years ago

manuelw99 commented 4 years ago

Hi,

i want to use your Plugin with google auth2.

Can you tell me, what to insert in those config fields? I already have Authorize URL, Client ID and Client Secret

Thanks a lot! Manuel

dominik-th commented 4 years ago

Hi Manuel,

please try the following settings:

Authorize URL: https://accounts.google.com/o/oauth2/v2/auth Token URL: https://oauth2.googleapis.com/token Userinfo URL: https://openidconnect.googleapis.com/v1/userinfo Userinfo ID: sub OAuth Scopes: openid email profile

as stated in this document: https://developers.google.com/identity/protocols/OpenIDConnect

manuelw99 commented 4 years ago

Hi,

thanks! No I get this error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_368804_27.piwik_loginoidc_provider' doesn't exist

What do I have to do right now?

dominik-th commented 4 years ago

Did you install the plugin through the marketplace? Which version of Matomo are you running?

Can you check your database and see if there is any table called something like piwik_loginoidc_provider?

manuelw99 commented 4 years ago

Hi,

i couldn't install the plugin through the marketplace. I got it from Github. Matomo is 3.12.0.

In my database, there is nothing called like piwik_loginoidc_provider.

dominik-th commented 4 years ago

Try to reinstall the plugin or create the db table manually by executing this command:

CREATE TABLE `piwik_loginoidc_provider` (
  `user` varchar(100) NOT NULL,
  `provider_user` varchar(255) NOT NULL,
  `provider` varchar(255) NOT NULL,
  `date_connected` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`provider_user`,`provider`),
  UNIQUE KEY `user_provider` (`user`,`provider`),
  CONSTRAINT `piwik_loginoidc_provider_ibfk_1` FOREIGN KEY (`user`) REFERENCES `piwik_user` (`login`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;