I am currently work on Django Python . My aim to authenticate the user from the Ldap directory . I do have my python code to access the ldap directory and retrieve the information.
Code :
import ldap
try:
l = ldap.open("ldap.forumsys.com")
l.protocol_version = ldap.VERSION2
username = "cn=read-only-admin,dc=example,dc=com"
password = "password"
l.simple_bind(username,password)
except ldap.LDAPError,e:
print e
My doubt is that , how would i implement this in my django? . How do use these code in django and to implement it?
Thanks in advance