Active Directory Authentication
stephan.diehl at gmx.net
Fri May 5 15:23:05 CEST 2006
On Fri, 05 May 2006 05:39:08 -0700, D wrote:
> Is it possible to have Python authenticate with Active Directory?
> Specifically what I'd like to do is have a user enter a
> username/password, then have Python check the credentials with AD - if
> what they entered is valid, for example, it returns a 1, otherwise a
> 0.. Thanks!
It's possible and you need the python-ldap package for it.
The actual authentication will look like (simplified):
dn = find_user_dn(user)
l = ldap.open(AD_HOST_URL)
l.protocol_version = ldap.VERSION3
obviously, you need to supply some function 'find_user_dn' that maps
the user to its DN.
More information about the Python-list