mirror of
https://github.com/dignajar/another-ldap-auth.git
synced 2026-04-26 21:55:47 +03:00
[GH-ISSUE #34] Some users in LDAP can be without groups #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @iamtio on GitHub (Jun 23, 2021).
Original GitHub issue: https://github.com/dignajar/another-ldap-auth/issues/34
Hello everyone.
Some users in LDAP can be without groups. In that case app returns 500
I think it should return another status, not 500
Docker image: dignajar/another-ldap-auth:2.2.1
Stacktrace:
[2021-06-23 10:35:31,561] ERROR in app: Exception on / [GET] Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/usr/local/lib/python3.9/site-packages/flask_httpauth.py", line 161, in decorated user = self.authenticate(auth, password) File "/usr/local/lib/python3.9/site-packages/flask_httpauth.py", line 238, in authenticate return self.verify_password_callback(username, client_password) File "/home/aldap/main.py", line 202, in login validGroups, matchedGroups, adGroups = aldap.validateGroups(username, matchingGroups) File "/home/aldap/aldap.py", line 104, in validateGroups adGroups.extend(element['memberOf']) KeyError: 'memberOf'@dignajar commented on GitHub (Jun 23, 2021):
Hi,
If the user doesn't have a group and you specified an
Allowed-Groupwe have to return 401 (Unauthorized)thank for reported the bug
@dignajar commented on GitHub (Jun 25, 2021):
Fixed in v2.3