mirror of
https://github.com/ansible/awx.git
synced 2026-04-04 17:55:06 -02:30
Merge pull request #5983 from ryanpetrello/release_3.1.3
Be more restrictive in catching LDAP exceptions.
This commit is contained in:
@@ -12,7 +12,6 @@ from django.dispatch import receiver
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.conf import settings as django_settings
|
from django.conf import settings as django_settings
|
||||||
from django.core.signals import setting_changed
|
from django.core.signals import setting_changed
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
|
||||||
|
|
||||||
# django-auth-ldap
|
# django-auth-ldap
|
||||||
from django_auth_ldap.backend import LDAPSettings as BaseLDAPSettings
|
from django_auth_ldap.backend import LDAPSettings as BaseLDAPSettings
|
||||||
@@ -90,8 +89,8 @@ class LDAPBackend(BaseLDAPBackend):
|
|||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
return super(LDAPBackend, self).authenticate(username, password)
|
return super(LDAPBackend, self).authenticate(username, password)
|
||||||
except ImproperlyConfigured:
|
except Exception:
|
||||||
logger.error("Unable to authenticate, LDAP is improperly configured")
|
logger.exception("Encountered an error authenticating to LDAP")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_user(self, user_id):
|
def get_user(self, user_id):
|
||||||
|
|||||||
Reference in New Issue
Block a user