ldap plugin for current version 2.5.2

NodeBB Plugins
  • hey hello, im new 🙂 i love the look and feel of nodebb... its awesome! but one general stuff i missing, i cant find a working ldap plugin... seems all very old... do you now there is any existing for current version?

  • @q16marvin, did you find any solution?

    I have installed manually the https://github.com/csturiale/nodebb-plugin-node-ldap but no LDAP Settings menu appears on administrator console.

  • @athedoor no it seems there is no working ldap plugin for current nodebb version...

  • any news to this? does anyone got it work with current version 2.8.12?

  • @q16marvin me again... 🙂

    I tried to get this up and running, and worked with @baris also, but it never came to fruition for me. Are you using OpenLDAP, or WindowsAD? Mine is the latter.

  • we use openldap... but in my case all settings under plugins -> ldap will not saved 🙂

  • @q16marvin Yes, I came across this same issue, but that was resolved with a commit that @baris provided. Let me dig that out.

  • would be realy nice... all our tools are connected to our ldap... (bookstack, zulip, wekan and so on). so nodebb is the last and it would be quit perfect if our employees could login with same username and pass like everywhere else 🙂

  • hi, i installed wrong version 🙂

    i docs it says:

    npm install nodebb-plugin-node-ldap

    but correct is:

    npm install @nodebb/nodebb-plugin-node-ldap

    and tadaaaa its working

    is set a commit 🙂

  • @q16marvin Beat me to it ! Good find - that's exactly the version. Glad it works for you - doesn't for me sadly 😕

  • show me your settings via pm, maybe i can help 🙂

  • @q16marvin thanks for noting that, I've fixed the install instructions in the readme

  • i found a bug in script, if checkbox is set:


    it tries to add ldap user to group "registered" and everytime it tries to create the group again. and thats let the server restarting:

    2023-04-28T12:48:50.475Z [4567/3263] - info: [GROUP] joinRegisteredGroup
    2023-04-28T12:48:50.475Z [4567/3263] - info: [GROUP] creating registered group
    2023-04-28T12:48:50.476Z [4567/3263] - info: [GROUP] join registered group
    2023-04-28T12:48:50.481Z [4567/3263] - error: uncaughtException: [[error:group-already-exists]]
    Error: [[error:group-already-exists]]
        at Groups.create (/root/nodebb/src/groups/create.js:24:10)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {"date":"Fri Apr 28 2023 12:48:50 GMT+0000 (Koordinierte Weltzeit)","error":{},"exception":true,"os":{"loadavg":[0.12,0.19,0.11],"uptime":3426.95},"process":{"argv":["/usr/bin/node","/root/nodebb/app.js"],"cwd":"/root/nodebb","execPath":"/usr/bin/node","gid":0,"memoryUsage":{"arrayBuffers":19242735,"external":21458138,"heapTotal":91611136,"heapUsed":86136800,"rss":162127872},"pid":3263,"uid":0,"version":"v18.16.0"},"stack":"Error: [[error:group-already-exists]]\n    at Groups.create (/root/nodebb/src/groups/create.js:24:10)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","trace":[{"column":10,"file":"/root/nodebb/src/groups/create.js","function":"Groups.create","line":24,"method":"create","native":false},{"column":5,"file":"node:internal/process/task_queues","function":"process.processTicksAndRejections","line":95,"method":"processTicksAndRejections","native":false}]}
    2023-04-28T12:48:50.481Z [4567/3263] - error: Error: [[error:group-already-exists]]
        at Groups.create (/root/nodebb/src/groups/create.js:24:10)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    2023-04-28T12:48:50.482Z [4567/3263] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    2023-04-28T12:48:50.484Z [4567/3263] - info: [app] Web server closed to connections.
    2023-04-28T12:48:50.489Z [4567/3263] - info: [app] Live analytics saved.
    2023-04-28T12:48:50.494Z [4567/3263] - info: [app] Database connection closed.
    2023-04-28T12:48:50.494Z [4567/3263] - info: [app] Shutdown complete.

    if think at this place in source:


    Who can do such Bugfix?

  • @q16marvin open an issue on the GitHub page please

  • I wonder what the purpose of that group is? Either way that groups.create method can be removed since groups.join already creates the group if it doesn't exist. I will make that change and publish a new version.

  • Published @nodebb/nodebb-plugin-node-ldap 2.0.5

  • thx upgraded it and it works 🙂

  • can i force login to use local db and not ldap? because in local also in ldap there are same username like "administrator" ^^ and now i cant login with local administrator user 😞

  • @q16marvin Same issues for me after activating the plugin. It would be nice to be able to to choose between LDAP / Windows AD and Local for authentication.

  • Hi,

    i have a little Change, that will also leave User when NOT in ldap group:

            groupJoin: (ldapGroup, ldapId, uid, callback) => {
                winston.verbose("[LDAP] groupJoin " + ldapGroup.cn + " for user " + ldapId + " uid " + uid)
                    (err, groupId) => {
                        if (err) {
                            return callback(err);
                        let members = ldapGroup.uniqueMember;
                        if (!Array.isArray(members)) {
                            members = [members];
                        winston.verbose("[LDAP] groupJoin members " + members && typeof members)
                        let found = false
                        if (members) {
                            members.forEach(member => {
                                if (member && member.indexOf(ldapId) != -1) {
                                    found = true
                        if (found) {
                            const groupsToJoin = [groupId];
                            if ((master_config.admin_groups || '').split(',').includes(ldapGroup.cn)) {
                                winston.verbose("[LDAP] joins admin group")
                            if ((master_config.moderator_groups || '').split(',').includes(ldapGroup.cn)) {
                                groupsToJoin.push('Global Moderators');
                            return groups.join(groupsToJoin, uid, callback);
                        } else {
    			const groupsToUnJoin = [groupId];
    			winston.verbose("[LDAP] unjoins group" + ldapGroup.cn + " uid " + uid);
    		return groups.leave(groupsToUnJoin, uid, callback);

    thats realy cool for use 🙂 maybe someone else will help it 🙂

Suggested Topics