I have been trying to get ldap authentication to work but I have been unsuccessful. I don't know what else to try so I am turning to this group.
Here are the details. I'm sure it is something minor any help is appreciated! I changed a few of the details to help conceal information.
############################## django-auth-ldap ##############################
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
import ldap
from django_auth_ldap.config import LDAPSearch
AUTH_LDAP_SERVER_URI = "ldap://server:389"
AUTH_LDAP_BIND_DN = "CN=rfeng_svc,OU=Denver,OU=Service Accounts,DC=example,DC=com"
AUTH_LDAP_BIND_PASSWORD = "W*@*[3-AU*BfF2"
AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",
#ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)")
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
"is_active": "cn=active,ou=groups,dc=example,dc=com",
#"is_staff": "cn=staff,ou=groups,dc=example,dc=com",
"is_staff": "dc=example,dc=com",
"is_superuser": "cn=superuser,ou=groups,dc=example,dc=com"
}
if DEBUG:
import logging, logging.handlers
logfile = "django-ldap-debug.log"
my_logger = logging.getLogger('django_auth_ldap')
my_logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
logfile, maxBytes=1024 * 500, backupCount=5)
my_logger.addHandler(handler)
############################ end django-auth-ldap ############################
search_s('ou=users,dc=example,dc=com', 2, '(sAMAccountName=cstinemetz)') raised NO_SUCH_OBJECT({'info': "0000208D: NameErr: DSID-0310020A, problem 2001 (NO_OBJECT), data 0, best match of:\n\t'DC=example,DC=com'\n", 'matched': 'DC=example,DC=com', 'desc': 'No such object'},)
search_s('ou=users,dc=example,dc=com', 2, '(sAMAccountName=%(user)s)') returned 0 objects:
Authentication failed for cstinemetz