dominik-th / matomo-plugin-LoginOIDC

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

Email field mapping #38

Open ghost opened 3 years ago

ghost commented 3 years ago

Email field mapping

dominik-th commented 3 years ago

Thanks for your PR! Can you explain what you are trying to achieve here?

$emailId = $settings->emailId->getValue();
$this->signupUser($settings, $providerUserId, $emailId);

How do you want to sign up a user with an email address which is stored in the system settings?

ghost commented 3 years ago

If the key for email in the JSON is something like "corp_email" instead of "email" then LoginOIDC fails because "email" is null. This code permits us to choose the name of the "key" in the returned JSON.

Another idea is to reuse providerId: $this->signupUser($settings, $providerUserId, $emailId);