[python-ldap] AD objectGUID conversion to string

SUBHASHINI TATIPAMULA subhashini.tatipamula at gmail.com
Tue Mar 22 07:19:46 EDT 2016


Michael Ströder <michael at ...> writes:

> 
> Joseph L. Casale wrote:
> >>> Data in AD is typically utf-16 encoded.
> >>
> >> No! The LDAP interface of MS AD is LDAPv3 compliant and therefore uses 
UTF-8
> >> for LDAP syntax DirectoryString.
> > 
> > Well, to be specific I referred to data _in_ AD, not data _on the wire_. 
To be honest
> > it wasn't even relevant in this case but more for cases like setting 
unicodePwd.
> 
> Yes, 'unicodePwd' is very badly designed. Double quotes as single-byte 
ASCII
> chars enclosing the UTF-16 low-endian password value. Yuck!
> 
> But all other DirectoryString values are simply UTF-8.
> 
> Ciao, Michael.
> 
> 
> Attachment (smime.p7s): application/pkcs7-signature, 2398 bytes
> 
> _______________________________________________
> python-ldap mailing list
> python-ldap at ...
> https://mail.python.org/mailman/listinfo/python-ldap
> 


oracle_raw16_guid = 
'\x04\xb3\x97\xf4\xf7\xdc\x8bL\xa1\x08\xadk}\xfb\x1a\xa9'
import binascii
user_guid = binascii.hexlify(oracle_raw16_guid)


More information about the python-ldap mailing list