Fixed error occurring while LDAP authentication for a user with multiple email attributes. #5352

This commit is contained in:
Yogesh Mahajan 2022-09-27 15:38:48 +05:30 committed by GitHub
parent 1b11a6cd4b
commit 5fbb8b6204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -35,4 +35,5 @@ Bug fixes
| `Issue #5262 <https://github.com/pgadmin-org/pgadmin4/issues/5262>`_ - Ensure that the user management dialog should not allow the same email addresses with different letter casings when creating users.
| `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty.
| `Issue #5338 <https://github.com/pgadmin-org/pgadmin4/issues/5338>`_ - Fixed an issue where the prompt is not visible when clicking on the 'save results to file' button on the large data.
| `Issue #5352 <https://github.com/pgadmin-org/pgadmin4/issues/5352>`_ - Fixed error occurring while LDAP authentication for a user with multiple email attributes.
| `Issue #5368 <https://github.com/pgadmin-org/pgadmin4/issues/5368>`_ - Fixed the issue while downloading the file from the file manager.

View File

@ -97,7 +97,11 @@ class LDAPAuthentication(BaseAuthentication):
return status, msg
if 'mail' in ldap_user:
user_email = ldap_user['mail'].value
mail = ldap_user['mail'].value
if isinstance(mail, list) and len(mail) > 0:
user_email = mail[0]
else:
user_email = ldap_user['mail'].value
return self.__auto_create_user(user_email)