-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"LDAP user attributes empty" AFTER "LDAP connect succeeded" #252
Comments
Any chance you could share the full user fields? It's likely you can get the correct |
|
Hi @etianen, above is what I see when using LDAP3. I see the objectClass with 4 values of top, person, organizationalPerson, and user. Maybe I'm missing something, so please provide any guidance you can. Thank you for your help! |
Your call to |
I am having problems with getting my Django authentication system working with Active Directory.
I am able to sign in and it says LDAP connect succeeded, but then it fails and prints that 'LDAP user attributes empty.'
I was able to connect and see attributes when doing it in a Python Console using ldap3.
I've tried changing the OBJECT_CLASS to be 'person', 'user', 'inetOrgPerson', 'top' but all yield the same result.
Any ideas would be appreciated!
Settings (***** indicates sensitive info):
`AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_python3_ldap.auth.LDAPBackend',
)
LDAP_AUTH_URL = 'ldap://:389'
LDAP_AUTH_CONNECTION_USERNAME = ''
LDAP_AUTH_CONNECTION_PASSWORD = '*****' # TODO: Secure this!!!
LDAP_AUTH_FORMAT_USERNAME = 'django_python3_ldap.utils.format_username_active_directory'
LDAP_AUTH_USER_FIELDS = {
"username": "sAMAccountName",
"first_name": "givenName",
"last_name": "sn",
"email": "mail"
}
LDAP_AUTH_SEARCH_BASE = 'dc=priv,dc=*****g,dc=co'
LDAP_AUTH_OBJECT_CLASS = "user"
LDAP_AUTH_USER_LOOKUP_FIELDS = ("username",)
LDAP_AUTH_FORMAT_SEARCH_FILTERS = "django_python3_ldap.utils.format_search_filters"
LDAP_AUTH_SYNC_USER_RELATIONS = "django_python3_ldap.utils.sync_user_relations"
LDAP_AUTH_CLEAN_USER_DATA = "django_python3_ldap.utils.clean_user_data"
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
},
},
"loggers": {
"django_python3_ldap": {
"handlers": ["console"],
"level": "INFO",
},
},
}`
The text was updated successfully, but these errors were encountered: