LDAPCredentialsProvider class has two logical flaws:
1. Walking through matching results (and switching credentials) can cause an
exception that skip that loop (and any left potentially correct entries) trying
at once other credentials providers.
2. dnBuffer is not cleaned in loop causing incorrect DN construction.
Also for Lotus Domino R5 it causes problems (Domino LDAP server drops connection
when attempt to switch credentials for bound context).
I have changed all these problems and tested with Lotus Domino R5 LDAP server.
Check this code with other LDAP servers and include into OSUser latest release,