tykeal / ep_ldapauth

(Up for adoption) LDAP authentication plugin for Etherpad-lite
GNU General Public License v2.0
25 stars 20 forks source link

Module not working with Etherpad Lite 1.8.0 #43

Closed vivienlacourba closed 4 months ago

vivienlacourba commented 4 years ago

Hi,

I upgraded my etherpad-lite instance from 1.7.5 to 1.8.0 and after that I could not access any existing pads nor create new ones.

FYI I am using version 0.3.0 of the ep_ldapauth module along with NodeJS v8.17.0.

Reverting to etherpad-lite 1.7.5 using exactly the same settings.json cleared the issue.

Here is the error I was getting with 1.8.0 when running the DEV environment with logging set to DEBUG:

$ bin/run.sh
(...)
[2020-01-15 14:23:00.181] [DEBUG] message - from ypRhX1wzeL6Sb54DAAAA: {"component":"pad","type":"CLIENT_READY","padId":"nmc","sessionID":"null","password":null,"token":*****************","protocolVersion":2}
[2020-01-15 14:23:00.182] [DEBUG] console - ep_ldapauth.handleMessage
[2020-01-15 14:23:00.185] [ERROR] console - (node:8960) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'anonymousReadonly' of undefined
    at Object.exports.handleMessage [as hook_fn] (/srv/etherpad-lite/node_modules/ep_ldapauth/ep_ldapauth.js:189:36)
    at normalizedhook (/srv/etherpad-lite/src/static/js/pluginfw/hooks.js:15:27)
    at hookCallWrapper (/srv/etherpad-lite/src/static/js/pluginfw/hooks.js:21:14)
    at /srv/etherpad-lite/src/static/js/pluginfw/hooks.js:88:7
    at /srv/etherpad-lite/src/node_modules/async/lib/async.js:249:17
    at /srv/etherpad-lite/src/node_modules/async/lib/async.js:125:13
    at Array.forEach (<anonymous>)
    at _each (/srv/etherpad-lite/src/node_modules/async/lib/async.js:46:24)
    at async.each (/srv/etherpad-lite/src/node_modules/async/lib/async.js:124:9)
    at _asyncMap (/srv/etherpad-lite/src/node_modules/async/lib/async.js:248:13)
[2020-01-15 14:23:00.185] [ERROR] console - (node:8960) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
[2020-01-15 14:23:00.185] [ERROR] console - (node:8960) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks!

vivienlacourba commented 4 years ago

FYI I have the exact same issue after upgrading Node to v10.18.1.

madmath03 commented 4 years ago

Hi @vivienlacourba

I have the same issue. By any chance, do you see something like that in the startup logs:

[WARN] console - Removing user "ldapauth", because it has no "password" field.

Adding a dummy password to ldapauth in settings.json seemed to bypass the issue:

"users": {
    "ldapauth": {
        "password": "dummy_password",
        "url": "ldaps://ldap.example.com",
        "accountBase": "ou=Users,dc=example,dc=com",
        "accountPattern": "(&(objectClass=*)(uid={{username}}))",
        "displayNameAttribute": "cn",
        "searchDN": "uid=searchuser,dc=example,dc=com",
        "searchPWD": "supersecretpassword",
        "groupSearchBase": "ou=Groups,dc=example,dc=com",
        "groupAttribute": "member",
        "groupAttributeIsDN": true,
        "searchScope": "sub",
        "groupSearch": "(&(cn=admin)(objectClass=groupOfNames))",
        "anonymousReadonly": false
    }
},
jolly-jump commented 3 years ago

Hi. I have etherpad 1.8.6 running, well it really is the latest git and/or latest docker container, but says 1.8.6.

I had the dummy_password field, but removed it and it is working without the dummy password field.

I guess, that this has been fixed in etherpad.

pcworld commented 3 years ago

To me, it seems that this has been fixed by Etherpad 1.8.7 (https://github.com/ether/etherpad-lite/releases/tag/1.8.7), and indeed I don't need a dummy password anymore (I used to need it with 1.8.6):

Users without a password or hash property in settings.json are no longer ignored, so they can now be used by authentication plugins

vivienlacourba commented 4 months ago

Closing this as I have been running this plugin successfully with etherpad 1.8.18 and node v20.5.1