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

Fix for username = response[0]['dn'] KeyError #40

Open
netvoip opened this issue Jul 8, 2019 · 0 comments
Open

Fix for username = response[0]['dn'] KeyError #40

netvoip opened this issue Jul 8, 2019 · 0 comments

Comments

@netvoip
Copy link

netvoip commented Jul 8, 2019

Trying to test extension, not working out of the box as expected, got error when entering intentionally wrong credentials

flask_ldapconn\__init__.py", line 162, in authenticate
username = response[0]['dn']
KeyError: 'dn' 

Slight code changing required. In line 162 of __init__.py
except (LDAPInvalidDnError, LDAPInvalidFilterError, IndexError):
to empty
except:
gave correct error handling! Hope this will help to someone.

@netvoip netvoip changed the title Fix for username = response[0]['dn'] error Fix for username = response[0]['dn'] KeyError Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant