-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Describe the bug
When the USERNAME and PASSWORD of LDAPSettings are both None preloading the connection to the domain and synchronizing a user fail with the exception LDAPSchemaError: schema not present.
To Reproduce
Steps to reproduce the behavior:
- In the settings.py file of the Django project configure WAUTH_DOMAINS calling the constructor of LDAPSettings with USERNAME set to os.environ.get('NONEXISTENT_USER_VAR') and PASSWORD set to os.environ.get('NONEXISTENT_PASSWORD_VAR')
- Wait for the Django server to reload
- In a web browser open the root URL of the Django project
Expected behavior
The constructor of LDAPSettings validates its arguments and throws an exception whenever USERNAME or PASSWORD is None. That way an invalid Connection object is not passed to the underlying ldap3 library, which throws an exception that is unrelated to the USERNAME and PASSWORD being wrong.
Screenshots
N/A
Versions (please complete the following information):
- OS: Windows Server 2016
- IIS Version 10
- Django Version 4.2
- Python Version 3.11
Additional context
None
Metadata
Metadata
Assignees
Labels
No labels