mirror of
https://github.com/ansible/awx.git
synced 2026-04-06 18:49:21 -02:30
@@ -10,6 +10,7 @@ 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
|
||||||
@@ -75,7 +76,11 @@ class LDAPBackend(BaseLDAPBackend):
|
|||||||
if not feature_enabled('ldap'):
|
if not feature_enabled('ldap'):
|
||||||
logger.error("Unable to authenticate, license does not support LDAP authentication")
|
logger.error("Unable to authenticate, license does not support LDAP authentication")
|
||||||
return None
|
return None
|
||||||
return super(LDAPBackend, self).authenticate(username, password)
|
try:
|
||||||
|
return super(LDAPBackend, self).authenticate(username, password)
|
||||||
|
except ImproperlyConfigured:
|
||||||
|
logger.error("Unable to authenticate, LDAP is improperly configured")
|
||||||
|
return None
|
||||||
|
|
||||||
def get_user(self, user_id):
|
def get_user(self, user_id):
|
||||||
if not self.settings.SERVER_URI:
|
if not self.settings.SERVER_URI:
|
||||||
|
|||||||
Reference in New Issue
Block a user