Code Monkey home page Code Monkey logo

omeka-s-module-ldap's Introduction

Ldap module for Omeka S

Authentication with LDAP for Omeka S

Installation

The module requires the php extension php-ldap to be installed on the server.

From the zip file

Download the zip file from the latest release and unzip it into the modules folder

From source

cd /path/to/omeka-s/modules
git clone https://github.com/biblibre/omeka-s-module-Ldap.git Ldap
cd Ldap
composer install --no-dev

Configuration

LDAP servers configuration should be done in Omeka S main configuration file (config/local.config.php)

See https://docs.laminas.dev/laminas-authentication/adapter/ldap/

Example:

<?php
return [
    'ldap' => [
        'adapter_options' => [
            'server1' => [
                'host' => 'localhost',
                'username' => 'cn=admin,dc=example,dc=com',
                'password' => '*******',
                'bindRequiresDn' => true,
                'baseDn' => 'ou=People,dc=example,dc=com',
                'accountFilterFormat' => '(&(objectClass=posixAccount)(uid=%s))',
                'accountCanonicalForm' => 4,
                'accountDomainName' => 'example.com',
            ],
        ],
    ],
];

Usage

When a user is authenticated, a user is created inside the database with the role defined in the config form. Once created, an administrator can update the role.

Development

When a user is created during the first connection, the events ldap.user.create.pre and ldap.user.create.post are triggered so the user can be updated by another module before or after being saved into the database.

The ldap user identity is stored in a user setting (ldap_identity).

License

This module is published under the GNU General Public License (version 3 or later).

omeka-s-module-ldap's People

Contributors

jajm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omeka-s-module-ldap's Issues

Issue installing module on Omeka-S 3.2.0

Hi all,

I'm having an issue with installing the LDAP module on Omeka-S version 3.2.0.

It's on PHP version 8.1 and Ubuntu 18.

Once I complete enabling the module on the backend, when I go to the admin section in Omeka-S and click install, it crashes my entire Omeka-S website.

I get an .500 error page.

Error with LDAP test connection

Hello,

I have installed LDAP Module version 0.5.0 with Omeka S 4.0.1

I try to connect to a test server : Online LDAP Test Server - Forum Systems - which is fonctional with JXplorer -

with this configuration in /local.config.php :

'ldap' => [
    'adapter_options' => [
        'server1' => [
            'host' => 'ldap.forumsys.com',
            'username' => 'cn=read-only-admin,dc=example,dc=com',
            'password' => 'password',
            'bindRequiresDn' => true,
            'baseDn' => 'ou=mathematicians,dc=example,dc=com',
            'accountFilterFormat' => '(&(objectClass=posixAccount)(uid=%s))',
            'accountCanonicalForm' => 4,
            'accountDomainName' => 'example.com',
        ],
    ],
],  

I can’t connect to myomekas.com/login where i get the following message : “Email ou mot de passe invalide” and no user is created.

In the logs i get the following message :

Ldap: 0x1: Failed to retrieve DN for account: [email protected] [0x51 (Can’t contact LDAP server; getLastError: could not call ldap_get_option because LDAP resource was not of type resource): ldap://ldap.forumsys.com:389]

I tried a lot of other config with no more result.

Could you tell me what’s wrong ? Is it an issue or a incorrect configuration ?
Many thanks in advance.
Gil

Issue authenticating using e-mail

While I have this configured and working for usernames, I am having trouble getting any authentication via e-mail address instead of username. Currently when someone logs in, a user is created as DOMAIN\user. However, the previous LDAP plugin by digihum created users as [email protected], and I need these accounts that already exist to continue working as they already own assets, and have correct access. Any ideas?

If this is not possible, could an option be added to parse the username off of the beginning when an '@' is detected and use it for authentication, but record and use the user in the email format to line up with the previous plug-in? Sort of a 'compatibility mode', so to speak?

Omeka S Not using Plugin

I have the plugin activated but omeka S version 3.1.0 does not use the plugin when authenticating. It uses the form included with this ldap module but not the ldap adapater for authentication. Is there a way to for the use of the module or was there a change in Omeka S that makes the plugin not work?

LDAP module installation on Omeka S 3.2.0

Hi,

I'm having an issue with installing the LDAP module on Omeka-S version 0.3.2.

We're on PHP 7.4.26 on RedHat 8.5.

After I install the module, I get a 500 error in my browser when I navigate to our Omeka instance. The only way to fix this is to remove the ldap module folder from the modules directory. However, the module is still installed.

I've looked through all my logs and there's nothing in the logs.

I would appreciate some help with this.

Undefined Constant

We are trying to get LDAP module working on your installation of omeka S to talk to our University authentication system. We have followed the instructions for the installation, got the php extension installed and can communicate with it from the command line. We have also set up our local.config.php. However when logging in we can see the following error in the log:

2022-02-11T13:50:22+00:00 ERR (3): Error: Undefined constant "Ldap\Authentication\Adapter\identity" in /var/www/html/omeka-s/modules/Ldap/src/Authentication/Adapter/LdapAdapter.php:75

Stack trace:
#0 /var/www/html/omeka-s/vendor/laminas/laminas-authentication/src/AuthenticationService.php(111): Ldap\Authentication\Adapter\LdapAdapter->authenticate()
#1 /var/www/html/omeka-s/application/src/Controller/LoginController.php(54): Laminas\Authentication\AuthenticationService->authenticate()
#2 /var/www/html/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\LoginController->loginAction()
#3 /var/www/html/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#4 /var/www/html/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners()
#5 /var/www/html/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(103): Laminas\EventManager\EventManager->triggerEventUntil()
#6 /var/www/html/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch()
#7 /var/www/html/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch()
#8 /var/www/html/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners()
#9 /var/www/html/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil()
#10 /var/www/html/omeka-s/index.php(21): Laminas\Mvc\Application->run()
#11 {main}`

We are not sure if it is something we have not set up properly or if it might be some kind of bug?
We would really appreciate your assistance,

Sanjin

Issues with authenticating

Hi @jajm Im having issues with authenticating with LDAP, im on Omeka-S 3.2.1 and using php 8.1.

The error message I get are credentials are invalid.

Ldap: 0x1: Failed to retrieve DN for account: [email protected] [Failed to connect to LDAP server: xxxxx.uct.ac.za:001]

Kindly advise if you are aware of any issues.

The module does not establish a network connection to the LDAP server

Can you help? I don't know why the module is not working.

The tcpdump indicates that when I try to log into Omeka, nothing connects to the LDAP server (no network traffic to the LDAP server) to check permissions.

The console command (on the same server as Omeka) ldapsearch -x -H ldap://xxx.xxx.xxx.xxx.xx..... returns what it needs, so there is no network lock, the user and password are correct.

php ldap module is loaded, selinux is disabled. Apache2 correctly serves pages on port 80 (without ssl).

php error messages return:

<br />
<b>Deprecated</b>:  strcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in <b>/var/www/html/modules/Ldap/vendor/laminas/laminas-ldap/src/Ldap.php</b> on line <b>617</b><br />

after adding var_dump to the file \Ldap\src\Authentication\Adapter\LdapAdapter.phpLdapAdapter.php

$this->logger->err(sprintf('__Ldap: %s', var_dump($result))); 

returns more:

<b>Deprecated</b>:  strcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in <b>/var/www/html/modules/Ldap/vendor/laminas/laminas-ldap/src/Ldap.php</b> on line <b>617</b><br />
object(Laminas\Authentication\Result)#616 (3) {
  ["code":protected]=>
  int(0)
  ["identity":protected]=>
  string(24) "[email protected]"
  ["messages":protected]=>
  array(4) {
    [0]=>
    string(45) "Authority not found: [email protected]"
    [1]=>
    string(0) ""
    [2]=>
    string(273) "host=xxx.xxx.xxx.xxx.xx,username=cn=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xx,password=*****,bindRequiresDn=1,baseDn=ou=xxxxxxxx,dc=xxx,dc=xxx,dc=xxx,dc=xx,accountFilterFormat=(&(objectClass=posixAccount)(uid=%s)),accountCanonicalForm=3,accountDomainName=xxx.xxx.xxx.xx"
    [3]=>
    string(59) "[email protected] authentication failed: "
  }
}

my config /config/local.config.php

            'server1' => [
                'host' => 'xxx.xxx.xxx.xxx.xx',
                'username' => 'cn=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xx',
                'password' => 'xxxxxxx',
                'bindRequiresDn' => true,
                'baseDn' => 'ou=xxxx xxx,dc=xxx,dc=xxx,dc=xxx,dc=xx',
                'accountFilterFormat' => '(&(objectClass=posixAccount)(uid=%s))',
                'accountCanonicalForm' => 3,
                'accountDomainName' => 'xxx.xxx.xxx.xx',
            ],

Omeka log says nothing (system logs don't show anything either)

tail -f /var/www/html/logs/application.log

2023-09-08T09:30:52+00:00 ERR (3): Ldap:
2023-09-08T09:30:52+00:00 ERR (3): __Ldap:
2023-09-08T09:40:49+00:00 ERR (3): Ldap:
2023-09-08T09:40:49+00:00 ERR (3): __Ldap:

Any idea where I should look for the error?

Laminas-ldap version needs to be updated for PHP 8.1

We're testing our Omeka-S instance with Omeka 4.0.1 and PHP 8.1 and running into problems with the Laminas-ldap component in this module. The laminas code has been updated to remove the deprecation problem, so the dependency here needs to be updated from tag 2.10.3 to the current tag (currently 2.17.0). Is it possible to get a quick update for PHP 8.1 compatibility?

"version": "2.10.3",

Can security group be included in LDAP servers configuration

Hi All,

I'm having issues with limiting user access to my security group in AD.

I have observed that the LDAP servers configuration does not allow the addition of code to facilitate a security group to be configured as the search container.

This will greatly assist in limiting access to certain users within our OU.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.