Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ldap
- from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
- # Baseline configuration.
- AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com"
- AUTH_LDAP_BIND_DN = "cn=django-agent,dc=example,dc=com"
- AUTH_LDAP_BIND_PASSWORD = "marksheet"
- AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",
- ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
- AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=django,ou=groups,dc=example,dc=com",
- ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)"
- )
- AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
- AUTH_LDAP_REQUIRE_GROUP = "cn=enabled,ou=django,ou=groups,dc=example,dc=com"
- AUTH_LDAP_USER_ATTR_MAP = {
- "first_name": "firstname",
- "last_name": "lastname",
- }
Add Comment
Please, Sign In to add comment