[python-ldap] Problems with using SASL and unicode

Michael Ströder michael at stroeder.com
Wed May 7 18:32:31 CEST 2014


Luminita Moruz wrote:
> I am trying to use python-ldap with SASL. but I am not able to get SASL
> working when the username or password contain special characters.
> def main():
> [..]
>     u = u"user"
>     p = u"pass"
>     my_function(u.encode("utf-8"), p.encode("utf-8"))
> [..]
> {'info': '8009030C: LdapErr: DSID-0C0904F8, comment: AcceptSecurityContext
> error, data 52e, v23f0', 'desc': 'Invalid credentials'} otherwise.

This is buggy MS AD. Use .encode('iso-8859-1') with this crap
(although the SASL handshake observed with Wireshark also mentions UTF-8).

Ciao, Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2398 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20140507/e0b6be18/attachment.bin>


More information about the python-ldap mailing list