python3: ldap encrypted binddn must be a string type

This commit is contained in:
Paul Marillonnet 2020-02-07 15:10:29 +01:00
parent f8d17c020e
commit 2bbce09b6f
1 changed files with 2 additions and 2 deletions

View File

@ -272,8 +272,8 @@ class LDAPUser(User):
data = dict(self.ldap_data)
data['block'] = dict(data['block'])
if data['block'].get('bindpw'):
data['block']['encrypted_bindpw'] = crypto.aes_base64_encrypt(
settings.SECRET_KEY, force_bytes(data['block']['bindpw']))
data['block']['encrypted_bindpw'] = force_text(crypto.aes_base64_encrypt(
settings.SECRET_KEY, force_bytes(data['block']['bindpw'])))
del data['block']['bindpw']
session[self.SESSION_LDAP_DATA_KEY] = data