mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
Merge pull request #2739 from ryanpetrello/fix-2738
fix a bug in multi-LDAP authentication
This commit is contained in:
commit
a13712074f
@ -110,12 +110,13 @@ class LDAPBackend(BaseLDAPBackend):
|
||||
pass
|
||||
try:
|
||||
user = super(LDAPBackend, self).authenticate(username, password)
|
||||
try:
|
||||
user.ldap_user._get_groups().get_group_dns()
|
||||
except ImproperlyConfigured:
|
||||
logger.exception(_("Encountered an error populating user {} from LDAP").format(user.username))
|
||||
user.delete()
|
||||
raise
|
||||
if user and getattr(user, 'ldap_user', None):
|
||||
try:
|
||||
user.ldap_user._get_groups().get_group_dns()
|
||||
except ImproperlyConfigured:
|
||||
logger.exception(_("Encountered an error populating user {} from LDAP").format(user.username))
|
||||
user.delete()
|
||||
raise
|
||||
return user
|
||||
except Exception:
|
||||
logger.exception("Encountered an error authenticating to LDAP")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user