fix: user login and creation with LDAP (#2107)

* Corrected if statement to check if a results was returned by the LDAP search. And decoded the user_attributes from binary data to string

* removed trailing spaces

* Revert asserts in LDAP unit test back

Since an empty tuple is still a result, an user is created and the result should not be false.

* Simplified code

* Extended the LDAP implementation

* fix ldap authentication and user creation

* modified docs to include new LDAP environment variables

* update tests and linting

* add libldap-2.4-2 as runtime dependency for the api

---------

Co-authored-by: Erik Landkroon <eriklandkroon@gmail.com>
This commit is contained in:
Carter
2023-02-11 13:16:33 -06:00
committed by GitHub
parent 2a929865e2
commit da60e56982
8 changed files with 244 additions and 48 deletions

View File

@@ -36,9 +36,14 @@ LANG=en-US
# Configuration for authentication via an external LDAP server
LDAP_AUTH_ENABLED=False
LDAP_SERVER_URL=None
LDAP_TLS_INSECURE=False
LDAP_TLS_CACERTFILE=None
LDAP_BIND_TEMPLATE=None
LDAP_BASE_DN=None
LDAP_ADMIN_FILTER=None
# LDAP_SERVER_URL=""
# LDAP_TLS_INSECURE=False
# LDAP_TLS_CACERTFILE=
# LDAP_BASE_DN=""
# LDAP_QUERY_BIND=""
# LDAP_QUERY_PASSWORD=""
# LDAP_USER_FILTER=""
# LDAP_ADMIN_FILTER=""
# LDAP_ID_ATTRIBUTE=uid
# LDAP_NAME_ATTRIBUTE=name
# LDAP_MAIL_ATTRIBUTE=mail