mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
fix a bug in multi-LDAP authentication
see: https://github.com/ansible/tower/issues/2738
This commit is contained in:
parent
c09a23f063
commit
2102c1ef0a
@ -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