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
5 stars 2 forks source link

Support in Piwigo NG app #5

Open tdijkstra opened 1 year ago

tdijkstra commented 1 year ago

Hi,

I get a 401 error while trying to use the Piwigo NG app while using this plugin. Is it true that isn't working at the moment? Could be that I'm getting something wrong..

Tim

sshambar commented 1 year ago

I'm using the NG app with Piwigo 13 + plugin, and it's working fine... keep in mind that the NG app uses the piwigo web services api (ws.php), so it uses passwords stored in the Piwigo database -- if you're not syncing the passwords with the external authentication system, then those logins will fail.

Also, make sure the webserver does not enforce the use of external authentication for piwigo/ws.php and piwigo/i.php locations, or they may be blocked and not allow the NG app to access the webservices api to even try the native piwigo login :)

For the plugin to support the NG app natively, it would have to be able to authenticate directly with the backend authenticator - but as that system is, by definition, "External" to piwigo, it doesn't have any way to do that (the login could be OAuth, CAS, HTTP-Auth, SAML, OpenID, Kerberos, or really anything... and the plugin would need to have client support/configuration for whatever technology was being used...)

If you understand the above and still think there's a bug, please let me know!

daniele-athome commented 1 year ago

If you use Authentik or other external authentication systems, you need to exclude these paths:

^/ws.php
^/i.php
^/_data/i/.*

Although for the last one, beware of this: https://github.com/Piwigo/Piwigo/issues/1349 (long standing Piwigo issue)

And sync the password between Piwigo and the external authentication system - or even better, set a dedicated password in Piwigo so you can use it like an app password.