jelix / multiauth-module

Module providing a plugin for jAuth that allows multiple authentication providers
MIT License
0 stars 1 forks source link

installation into LWC 3.6.(4-pre) #9

Open josemvm opened 1 year ago

josemvm commented 1 year ago

hi @laurentj

i'm trying to install the module on LWC 3.6.4-pre

i'm following the https://github.com/jelix/multiauth-module/blob/master/INSTALL_INTO_LIZMAP.md#manual-installation-without-composer-into-lizmap-36-or-higher and everything is ok until here

next step here https://github.com/jelix/multiauth-module/blob/master/LDAP.md#configuration-of-the-ldap-plugin

[multiauth] providers[]=ldap:multiauth_ldap

[multiauth_ldap] ; profile to use for ldap ldapprofile = "myldap"

how should i adapt the original file (auth_multi.coord.ini.php) with these parameters!? PS: i've "myldap" profile into profiles.ini.php file as usual

many many unsuccessful attempts...

thanks

josemvm commented 1 year ago

it seems to me that the auth.coord.ini.php file is not being read by lwc...

is the localconfig.ini.php file supposed to be changed after installing the multiauth module or not? the localconfig.ini.php file has not changes after the installation of the multiauth module...

josemvm commented 1 year ago

these are my steps:

php lizmap/install/configurator.php multiauth Configuration migration is starting Configuration migration is finished Configuration is starting All modules dependencies are ok Configuration starts Modules are configured Configuration is finished

php lizmap/install/installer.php -v Installation is starting All modules dependencies are ok Installation starts All modules are installed or upgraded Installation is finished

./lizmap/install/clean_vartmp.sh ./lizmap/install/set_rights.sh


auth.coord.ini.php file:

[multiauth]

; name of the dao to get user data dao = "jauthdb~jelixuser"

; profile to use for jDb profile = "jauth"

; list of authentication providers providers[]=ldap:multiauth_ldap

[multiauth_ldap] <== my changes == ; profile to use for ldap <== my changes == ldapprofile = "myldap" <== my changes ==

providers[]=dbaccounts


profiles.ini.php file:

; ldap configuration. See documentation [ldap:lizmapldap] hostname=xxx.xxx.xxx.xxx5 port=389 adminUserDn="cn=manager,dc=xxxxx,dc=pt" adminPassword="xxxxxxxxxxxxx" searchUserBaseDN="ou=users,dc=xxxxx,dc=pt" searchUserFilter="(&(objectClass=)(cn=%%LOGIN%%))" searchUserFilter="(&(objectClass=)(uid=%%LOGIN%%))" bindUserDN[]="cn=%?%,ou=users,dc=xxxxx,dc=pt" bindUserDN[]="uid=%?%,ou=users,dc=xxxxx,dc=pt" searchAttributes="uid:login,cn,givenName:firstname,sn:lastname,mail:email,o:organization,telephoneNumber:phonenumber" searchGroupFilter="(&(objectClass=)(cn=)(memberUid=%%LOGIN%%))" searchGroupProperty="cn" searchGroupBaseDN="ou=Groups,dc=xxxxx,dc=pt"


./lizmap/install/clean_vartmp.sh ./lizmap/install/set_rights.sh .service apache2 restart


i can't authenticate against my openldap server as usual

@laurentj can you help me please?

thanks in advance

laurentj commented 1 year ago

Hi,

The module is pre-configured into Lizmap. So you must not change auth.coord.ini.php (and in fact, all files into lizmap/app/system must not be changed). The ldap profile into profiles.ini.php should be named lizmapldap, so you must have a section [ldap:lizmapldap] into profiles.ini.php

You just have to change the content of the section [ldap:lizmapldap] into profiles.ini.php, with your ldap parameters. See https://docs.lizmap.com/current/en/install/ldap.html#ldap-settings

laurentj commented 1 year ago

I updated the ldap documentation https://github.com/jelix/multiauth-module/commit/c967a2f0f7a4e5bc7d5b89d1f1cac60cd864ec06 . I also tested the multiauth module into lizmap, by following the documentation and it works.

If you still have some issues, you probably have incorrect ldap parameters. Enable the debugging mode to see if there are errors. It could help you to fix your parameters

josemvm commented 1 year ago

hi @laurentj thanks for your helps

unfortunately it doesn't work... and i have no logs!

i have no problems with my openldap server and all parameters are correct as before


so alternatively i enabled the ldapdaomodule:

php lizmap/install/configurator.php ldapdao Configuration is starting All modules dependencies are ok Configuration starts Configuration of the module ldapdao Modules are configured Configuration is finished

php lizmap/install/installer.php -v Installation is starting All modules dependencies are ok Installation starts Module jelix installed Module jacl2 installed Module jacl2db installed Module ldapdao installed <== module installation confirmed == Module jcommunity installed Module jauthdb_admin installed Module master_admin installed Module jacl2db_admin installed Module proj4php installed Module admin installed Module lizmap installed Module view installed Module dynamicLayers installed Module dataviz installed Module filter installed Module action installed All modules are installed or upgraded Installation is finished

this installation adds the following information to the localconfig.ini.php file:

[modules] ldapdao.enabled=on ldapdao.localconf=1

[coordplugin_auth] driver=ldapdao

under the [ldap:lizmapldap] section i add all my openldap parameters to profiles.ini.php file as in the previous comment

and it works!


back to multiauthmodule with manual installation https://github.com/jelix/multiauth-module/blob/master/INSTALL_INTO_LIZMAP.md#manual-installation-without-composer-into-lizmap-36-or-higher

php lizmap/install/configurator.php multiauth Configuration migration is starting Configuration migration is finished Configuration is starting All modules dependencies are ok Configuration starts Modules are configured Configuration is finished

php lizmap/install/installer.php -v Installation is starting All modules dependencies are ok Installation starts Module jelix installed Module jacl2 installed Module jacl2db installed <== there is no reference to installing the multiauth module == Module jcommunity installed Module jauthdb_admin installed Module master_admin installed Module jacl2db_admin installed Module proj4php installed Module admin installed Module lizmap installed Module view installed Module dynamicLayers installed Module dataviz installed Module filter installed Module action installed All modules are installed or upgraded Installation is finished

under the [ldap:lizmapldap] section i add all my openldap parameters to profiles.ini.php file as in the previous comment

and it doesn't work!


are you using manual installation without composer or automatic installation with composer?

i can't use the automatic installation with composer, i'am on ubuntu 20.04.6 LTS and i have a composer version limitation: Installed: 1.10.1-1 Candidate: 1.10.1-1

cp -n lizmap/my-packages/composer.json.dist lizmap/my-packages/composer.json composer require --working-dir=lizmap/my-packages "jelix/multiauth-module"

Do not run Composer as root/super user! See https://getcomposer.org/root for details Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Info from https://repo.packagist.org: #StandWithUkraine Using version ^1.2 for jelix/multiauth-module ./composer.json has been updated Loading composer repositories with package information Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting ./composer.json to its original content.


thanks again

josemvm commented 1 year ago

many installations from scratch and nothing happens and no logs too!... something is wrong... I have been using this module for years! a frustrated man :-(

laurentj commented 1 year ago

Where did you stored the multiauth directory ? Do you have this tree?

- lizmap
   -  lizmap-modules
       - multiauth
          - classes
          - install
          - module.xml
          - etc...

Did you installed Lizmap 3.6 from scratch or did you upgrade from Lizmap 3.5 by overwriting files?

Did you have exactly this application.init.php?

What have you got into lizmap/var/config/localconfig.ini.php?

i can't use the automatic installation with composer, i'am on ubuntu 20.04.6 LTS and i have a composer version limitation

You must not install Composer from Ubuntu packages. Remove the Composer package (sudo apt remove composer). Install the latest version of Composer. Download its latest version and move it as /usr/local/bin/composer (sudo mv composer.phar /usr/local/bin/composer and sudo chmod +x /usr/local/bin/composer.

josemvm commented 1 year ago

Do you have this tree?

- lizmap
   -  lizmap-modules
       - multiauth
          - classes
          - install
          - module.xml
          - etc...

yes

Did you installed Lizmap 3.6 from scratch or did you upgrade from Lizmap 3.5 by overwriting files?

from scratch

Did you have exactly this application.init.php?

yes

What have you got into lizmap/var/config/localconfig.ini.php?

nothing regarding the multiauth module

You must not install Composer from Ubuntu packages. Remove the Composer package (sudo apt remove composer). Install the latest version of Composer. Download its latest version and move it as /usr/local/bin/composer (sudo mv composer.phar /usr/local/bin/composer and sudo chmod +x /usr/local/bin/composer

ok, with automatic installation with composer evething works fine!


now i found the problem:

with manual installation without composer the configurator.php and installer.php don't work well because into lizmap/var/config/localconfig.ini.php there are no references to the multiauthmodule (instead of the ldapdaomodule manual installation):

[modules] multiauth.enabled=on multiauth.localconf=1

[coordplugin_auth] driver=multiauth


many many thanks my old chap ;-)

laurentj commented 1 year ago

with manual installation without composer the configurator.php and installer.php don't work well because into lizmap/var/config/localconfig.ini.php there are no references to the multiauth module (instead of the ldapdao module manual installation):

If there is nothing into localconfig about the module before the launch of configurator.php, it's normal. However, after executing configurator.php, you should have

multiauth.enabled=on
multiauth.localconf=1

this is one of the goals of the configurator to put these parameters into localconfig.ini..

I tried again to reproduce the issue :

$ php install/configurator.php multiauth
Configuration is starting
All modules dependencies are ok
Configuration starts
Configuration of the module multiauth
Modules are configured
Configuration is finished

And into localconfig (which was empty before the command), I have (comments removed):

[modules]
multiauth.enabled=on
multiauth.localconf=1

[coordplugin_auth]
driver=multiauth

I really don't understand why you have not this result.

josemvm commented 1 year ago

hi @laurentj

even an install from scratch my result is different from yours:

$ php install/configurator.php multiauth Configuration is starting All modules dependencies are ok Configuration starts Configuration of the module multiauth Modules are configured Configuration is finished

Configuration migration is starting Configuration migration is finished Configuration is starting All modules dependencies are ok Configuration starts === Configuration of the module multiauth is missing === Modules are configured Configuration is finished