PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` # How to bind to MS AD with python-ldap and various methods import ldap,ldap.sasl ldap_uri = "ldap://dc1.example.com" dn = "CN=Anna Blume,CN=Users,DC=addomain,DC=example,DC=com" sAMAccountName = "ABlume" userPrincipalName = "ablume@addomain.example.com" password = 'testsecret' trace_level = 2 l = ldap.initialize(ldap_uri,trace_level=trace_level) # Normal LDAPv3 compliant simple bind l.simple_bind_s(dn,password) # This is AD-specific and not LDAPv3 compliant l.simple_bind_s(userPrincipalName,password) # This is AD-specific and not LDAPv3 compliant l.simple_bind_s(userPrincipalName,password) # SASL bind with mech DIGEST-MD5 with sAMAccountName as SASL user name sasl_auth = ldap.sasl.sasl( { ldap.sasl.CB_AUTHNAME:sAMAccountName, ldap.sasl.CB_PASS :password, }, 'DIGEST-MD5' ) l.sasl_interactive_bind_s("", sasl_auth) # SASL bind with mech GSSAPI # with the help of Kerberos V TGT obtained before with command # kinit ablume@ADDOMAIN.EXAMPLE.COM sasl_auth = ldap.sasl.sasl({},'GSSAPI') l.sasl_interactive_bind_s("", sasl_auth)