Django使用LDAP

https://github.com/python-ldap/python-ldap

Quick usage example:

import ldap
l = ldap.initialize("ldap://my_ldap_server.my_domain")
l.simple_bind_s("","")
l.search_s("o=My Organisation, c=AU", ldap.SCOPE_SUBTREE, "objectclass=*")

参考脚本:https://www.ibm.com/developerworks/cn/aix/library/au-ldap_crud/index.html

注意将ldap.open改成ldap.initialize(),否则会报module 'ldap' has no attribute 'open'

  

posted @ 2019-06-03 16:45  番茄土豆西红柿  阅读(744)  评论(0编辑  收藏  举报
TOP