I am currently using Mac OS X 10.6.2 and am attempting to use
the ldap_sasl_interactive_bind_s API to do a digest-md5 authentication
against Active Directory (2008, though I don't think it matters what
flavor of AD is used). The bind works fine the first time. However, if I
unbind and attempt to rebind as the same user, it fails with
ldap_sasl_interactive_bind_s: Invalid credentials (49). If I bind with a
different user, then unbind, and bind as the original user, it works. I
created a simple program that illustrates the issue. When run, it binds
correctly, unbinds, and then fails on the second bind: