saltcorn icon indicating copy to clipboard operation
saltcorn copied to clipboard

Local authentication plugin

Open fiveoaksmn opened this issue 1 year ago • 5 comments

I would like to link Saltcorn to my Active Directory but can't use the standard ldap plugin. Need to specify the CA certificate. I took the ldap auth module code and modifued it and installed as a local plugin successfully. However Saltcorn is not recognizing it as an authentication plugin. The module is exporting authentication. Is there some limitation for locally installed plugins that they can't be used for authentication?

fiveoaksmn avatar Oct 04 '23 17:10 fiveoaksmn

  1. Auth plugins works only if installed in root (aka public) tenant. Than you can install and use it to other tenants also.
  2. You must restart saltcorn after installing of auth plugin.

PS: No, plugins installed with source='local' doesn't have any specific limitations (except obvious — you can't install them in tenant if public tenant admin set limits for unsafe plugins).

pyhedgehog avatar Oct 12 '23 15:10 pyhedgehog

Hi, I'm on version 0.9.1-beta.8 with Nodejs v18.17.1.

I've installed ldap-auth plugin in root instance. I can authenticate correctly in root tenant but the only login page that is shown at the "child's" is the default (email/password).

The plugin it's not shown in children's module section. Maybe I'm missing some installation steps?

TecnotramitGestion avatar Nov 30 '23 18:11 TecnotramitGestion

You still meed to install and configure plugin in every tenant.

pyhedgehog avatar Dec 03 '23 17:12 pyhedgehog

But how? I think it's no documented in saltcorn's wiki... And the plugin it's only shown in main (root) tenant...

TecnotramitGestion avatar Dec 04 '23 07:12 TecnotramitGestion

@glutamate I don't understand it too. Buttons for login page depends on tenant-installed auth plugins (https://github.com/saltcorn/saltcorn/blob/4d49bf2869217ecc439d9305cb799b536e8fc9c1/packages/server/auth/routes.js#L207-L217), but only plugins installed to root tenant registered to passport (https://github.com/saltcorn/saltcorn/blob/4d49bf2869217ecc439d9305cb799b536e8fc9c1/packages/server/app.js#L251-L253). Not sure what configuration (i.e. connection to ldap) will be used.

pyhedgehog avatar Dec 04 '23 14:12 pyhedgehog