Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some users in LDAP can be without groups #34

Closed
iamtio opened this issue Jun 23, 2021 · 2 comments
Closed

Some users in LDAP can be without groups #34

iamtio opened this issue Jun 23, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@iamtio
Copy link

iamtio commented Jun 23, 2021

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 dignajar added the bug Something isn't working label Jun 23, 2021
@dignajar
Copy link
Owner

Hi,
If the user doesn't have a group and you specified an Allowed-Group we have to return 401 (Unauthorized)

thank for reported the bug

@dignajar
Copy link
Owner

Fixed in v2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants