mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Prevent LDAP user from imposing existing Tower user.
This commit is contained in:
parent
7c2e5df659
commit
4f9875f895
@ -90,6 +90,12 @@ class LDAPBackend(BaseLDAPBackend):
|
||||
if not feature_enabled('ldap'):
|
||||
logger.error("Unable to authenticate, license does not support LDAP authentication")
|
||||
return None
|
||||
try:
|
||||
user = User.objects.get(username=username)
|
||||
if user and (not user.profile or not user.profile.ldap_dn):
|
||||
return None
|
||||
except User.DoesNotExist:
|
||||
pass
|
||||
try:
|
||||
return super(LDAPBackend, self).authenticate(username, password)
|
||||
except Exception:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user