Skip to content

LDAP Configuration doesn't pick up AUTH_LDAP_USER_SEARCH correctly. #25

@the-maldridge

Description

@the-maldridge

I am trying to debug LDAP configuration for allowing users to sign in with single sign on. My LDAP server is OpenLDAP with base schemas available for posixAccount and InetOrgPerson, which should be sufficient. SSO from netbox to ldap works, so I know it is possible to get django-auth-ldap to be happy with this setup at the least.

I added the following lines to my environment file to configure ldap, and changed the tag on the pulled image to be the ldap one:

AUTH_LDAP_ATTR_FIRSTNAME: "cn"
AUTH_LDAP_GROUP_SEARCH_BASEDN: "dc=example,dc=com"
AUTH_LDAP_GROUP_SEARCH_CLASS: "groupOfNames"
AUTH_LDAP_GROUP_TYPE: "GroupOfNamesType"
AUTH_LDAP_IS_ADMIN_DN: "cn=netbox_admin,ou=group,dc=example,dc=com"
AUTH_LDAP_IS_SUPERUSER_DN: "cn=netbox_admin,ou=group,dc=example,dc=com"
AUTH_LDAP_MIRROR_GROUPS: "true"
AUTH_LDAP_REQUIRE_GROUP_DN: "cn=netbox_ro,ou=group,dc=example,dc=com"
AUTH_LDAP_SERVER_URI: "ldaps://ldap.example.com"
AUTH_LDAP_START_TLS: "false"
AUTH_LDAP_USER_SEARCH_BASEDN: "ou=people,dc=example,dc=com"
AUTH_LDAP_USER_SEARCH_ATTR: "uid"
AUTH_LDAP_USER_DN_TEMPLATE: "uid=%(user)s,ou=people,dc=example,dc=com"
AUTH_LDAP_BIND_AS_AUTHENTICATING_USER: "true"

I reliably get the error message that AUTH_LDAP_USER_SEARCH is not an instance of LDAPSearch:

image

However when I check the type of that config attribute via a manage.py shell, the type is clearly LDAPSearch:

>>> type(_loaded_configurations[1].AUTH_LDAP_USER_SEARCH)
<class 'django_auth_ldap.config.LDAPSearch'>

I'm at my whit's end here for what could still be preventing this from working, is there something I've just missed?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions