Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

LDAP Error: ReferenceError: uid is not defined #561

Closed
geofflhenderson opened this issue Apr 20, 2020 · 3 comments
Closed

LDAP Error: ReferenceError: uid is not defined #561

geofflhenderson opened this issue Apr 20, 2020 · 3 comments

Comments

@geofflhenderson
Copy link

Attempted to configure Konga container to authenticate using LDAP to an Active Directory server and getting the following errors:

`lodash.templateSources[0]:9
((__t = (uid)) == null ? '' : __t) +
^

ReferenceError: uid is not defined
at eval (lodash.templateSources[0]:9:10)
at Object.groupSearchFilter (/app/config/ldap.js:19:20)
at LdapAuth._findGroups (/app/node_modules/ldapauth-fork/lib/ldapauth.js:311:32)
at /app/node_modules/ldapauth-fork/lib/ldapauth.js:366:12
at sendResult (/app/node_modules/ldapjs/lib/client/client.js:1395:12)
at messageCallback (/app/node_modules/ldapjs/lib/client/client.js:1421:16)
at Parser.onMessage (/app/node_modules/ldapjs/lib/client/client.js:1089:14)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at Parser.write (/app/node_modules/ldapjs/lib/messages/parser.js:111:8)
at Socket.onData (/app/node_modules/ldapjs/lib/client/client.js:1076:22)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:597:20)
I1126 20:14:13.318116 87782 executor.cpp:736] Container exited with status 1
I1126 20:14:14.318631 87813 process.cpp:926] Stopped the socket accept loop`

The uid value is not populated in our Active Directory server.

I've tried using the default values for:

KONGA_LDAP_USER_SEARCH_FILTER
KONGA_LDAP_USER_ATTRS
KONGA_LDAP_ATTR_USERNAME

I've also tried the following settings since the Konga username should map to our sAMAccountName:

KONGA_LDAP_USER_SEARCH_FILTER: sAMAccountName={{username}}
KONGA_LDAP_USER_ATTRS: sAMAccountName,givenName,sn,mail
KONGA_LDAP_ATTR_USERNAME: sAMAccountName

However, I still get the "uid is not defined" error message.

@debu99
Copy link
Contributor

debu99 commented May 1, 2020

maybe this issue #551

@mdostal-hci
Copy link

Try to set KONGA_LDAP_GROUP_SEARCH_FILTER="(member={{distinguishedName}})" (by default it searches by uid which is not provided by AD)

@geofflhenderson
Copy link
Author

@mdostal-hci Thank you this works for me now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants