ldap4net
ldap4net copied to clipboard
Binding Always Fails
Describe the bug Unable to bind on Linux platform, but works on windows
To Reproduce
simply attempt to bind
cn.Bind(LdapForNet.Native.Native.LdapAuthType.Digest, new LdapCredential { UserName = "user@domain", Password = "password", AuthorizationId = "u:user" });
Expected behavior A successful binding
Desktop (please complete the following information):
- OS: Linux Ubunto 20.4
Additional context Using to LDAP into Active Directory
Did you install the prerequisites? For Linux\OSX you must ensure you have the latest OpenLDAP client libraries installed from http://www.openldap.org. Also you should install libsasl modules for digest-md5 (libsasl2-modules)
I will look into it now, I really love how slim this library is personally, I just want it to work so I can use basic searching functionality.
I installed the libs for sasl2-modules. My Bind call looks like this:
cn.Bind(LdapForNet.Native.Native.LdapAuthType.Digest, new LdapCredential
{
UserName = "logonName",
Password = "password",
AuthorizationId = "dn:CN=First Last,DC=first,DC=second,DC=third"
});
Not sure if that is the correct format, it may be my incorrect input. Please advise.
Update
The error returned looks like this LdapForNet.LdapInvalidCredentialsException: Invalid credentials. 8009030B: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 0, v1db1. Result: 49. Method: BindSasl
You dont need AuthorizationId. Example: https://github.com/flamencist/ldap4net/blob/a126279e6cfc14547d762f8cff23ee0568bce956/LdapForNet.Tests/LdapConnectionTests.cs#L53
Is authentication work on linux?