Guest User

Untitled

a guest
Jul 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import ldap
  2. from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
  3. # Baseline configuration.
  4. AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com"
  5. AUTH_LDAP_BIND_DN = "cn=django-agent,dc=example,dc=com"
  6. AUTH_LDAP_BIND_PASSWORD = "marksheet"
  7. AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",
  8. ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
  9. AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=django,ou=groups,dc=example,dc=com",
  10. ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)"
  11. )
  12. AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
  13. AUTH_LDAP_REQUIRE_GROUP = "cn=enabled,ou=django,ou=groups,dc=example,dc=com"
  14. AUTH_LDAP_USER_ATTR_MAP = {
  15. "first_name": "firstname",
  16. "last_name": "lastname",
  17. }
Add Comment
Please, Sign In to add comment