server/sources/ldapuser.py
branchstable
changeset 4716 55b6a3262071
parent 4556 43c14e0e8972
child 4719 aaed3f813ef8
equal deleted inserted replaced
4715:d3f87ee74fe4 4716:55b6a3262071
   446         conn.simple_bind_s(user['dn'], userpwd)
   446         conn.simple_bind_s(user['dn'], userpwd)
   447 
   447 
   448     def _auth_cram_md5(self, conn, user, userpwd):
   448     def _auth_cram_md5(self, conn, user, userpwd):
   449         from ldap import sasl
   449         from ldap import sasl
   450         auth_token = sasl.cram_md5(user['dn'], userpwd)
   450         auth_token = sasl.cram_md5(user['dn'], userpwd)
   451         conn.sasl_interactive_bind_s('', auth_tokens)
   451         conn.sasl_interactive_bind_s('', auth_token)
   452 
   452 
   453     def _auth_digest_md5(self, conn, user, userpwd):
   453     def _auth_digest_md5(self, conn, user, userpwd):
   454         from ldap import sasl
   454         from ldap import sasl
   455         auth_token = sasl.digest_md5(user['dn'], userpwd)
   455         auth_token = sasl.digest_md5(user['dn'], userpwd)
   456         conn.sasl_interactive_bind_s('', auth_tokens)
   456         conn.sasl_interactive_bind_s('', auth_token)
   457 
   457 
   458     def _auth_gssapi(self, conn, user, userpwd):
   458     def _auth_gssapi(self, conn, user, userpwd):
   459         # print XXX not proper sasl/gssapi
   459         # print XXX not proper sasl/gssapi
   460         import kerberos
   460         import kerberos
   461         if not kerberos.checkPassword(user[self.user_login_attr], userpwd):
   461         if not kerberos.checkPassword(user[self.user_login_attr], userpwd):