sshambar / ExternalAuth

Piwigo plugin that supports login via webserver provided identity
https://piwigo.org/ext/extension_view.php?eid=894
GNU General Public License v2.0
4 stars 2 forks source link

Add support for getting email from server variable #4

Open jobec opened 3 years ago

jobec commented 3 years ago

First of all, thanks for this nice plugin!

I'm using it in combination with Caddy in front of Piwigo and these Caddy plugins:

I use it to let people log in to my album with a Google or Azure (Hotmail, outlook, etc etc account). It forwards some user details in specific HTTP headers. One of them I used in this plugin as the source for the username.

What would be a great addition is to also do the same for the user's email address. Now it's only possible to set the user's name + some fixed domain as a email address. But as the real email is in the OpenID Connect token from Google/Azure, I want to get it from there. The chance that every visitor is under one domain with his email is also near zero.

sshambar commented 3 years ago

I'm not familiar with Caddy, but if it supplies the email as a Server variable, it wouldn't be difficult to add an option to use that as the default when creating an account (perhaps even syncing the value with the account on authentication?...hmmm).

I'm a little swamped this week, but I'll see if I can investigate this "soon" (perhaps in the coming weeks)

sshambar commented 11 months ago

I've pushed an updated version (0.5.1) that adds support for defaulting a new users email from server variables. If you're still interested in this feature, give it a try, and if it works for you I'll push a new release :)